{"cells":[{"attachments":{},"cell_type":"markdown","metadata":{"id":"HJMQf5rhg19t"},"source":["# 10-714 Homework 4\n","\n","In this homework, you will leverage all of the components built in the last three homeworks to solve some modern problems with high performing network structures. We will start by adding a few new ops leveraging our new CPU/CUDA backends. Then, you will implement convolution, and a convolutional neural network to train a classifier on the CIFAR-10 image classification dataset. Then, you will implement recurrent and long-short term memory (LSTM) neural networks, and do word-level prediction language modeling on the Penn Treebank dataset.\n","\n","As always, we will start by copying this notebook and getting the starting code.\n","Reminder: __you must save a copy in drive__."]},{"cell_type":"code","execution_count":1,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":36344,"status":"ok","timestamp":1703488060496,"user":{"displayName":"伍嘉辉","userId":"06711267999106587498"},"user_tz":-480},"id":"Wi4nW9Ztg194","outputId":"727e772e-6c29-40ee-e7c1-9363e89f96d7"},"outputs":[{"name":"stdout","output_type":"stream","text":["Mounted at /content/drive\n","/content/drive/Othercomputers/My MacBook Pro/hw4\n","Collecting git+https://github.com/dlsys10714/mugrade.git\n","  Cloning https://github.com/dlsys10714/mugrade.git to /tmp/pip-req-build-erluxsm7\n","  Running command git clone --filter=blob:none --quiet https://github.com/dlsys10714/mugrade.git /tmp/pip-req-build-erluxsm7\n","  Resolved https://github.com/dlsys10714/mugrade.git to commit 656cdc2b7ad5a37e7a5347a7b0405df0acd72380\n","  Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n","Building wheels for collected packages: mugrade\n","  Building wheel for mugrade (setup.py) ... \u001b[?25l\u001b[?25hdone\n","  Created wheel for mugrade: filename=mugrade-1.2-py3-none-any.whl size=3932 sha256=bcc02ce841617daba5af60a614e9e963ba093dd5c05a4a45ca17cbdb189b57c6\n","  Stored in directory: /tmp/pip-ephem-wheel-cache-d7rp460_/wheels/8b/ba/3a/621da1207eab160c01968c5e0bd1266f505b9e3f8010376d61\n","Successfully built mugrade\n","Installing collected packages: mugrade\n","Successfully installed mugrade-1.2\n","Collecting pybind11\n","  Downloading pybind11-2.11.1-py3-none-any.whl (227 kB)\n","\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m227.7/227.7 kB\u001b[0m \u001b[31m1.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hInstalling collected packages: pybind11\n","Successfully installed pybind11-2.11.1\n"]}],"source":["# Code to set up the assignment\n","from google.colab import drive\n","drive.mount('/content/drive')\n","# %cd /content/drive/MyDrive/\n","# !mkdir -p 10714\n","# %cd /content/drive/MyDrive/10714\n","# !git clone https://github.com/dlsys10714/hw4.git\n","# %cd /content/drive/MyDrive/10714/hw4\n","\n","!ln -s '/content/drive/Othercomputers/My MacBook Pro/hw4' /content/hw4\n","%cd /content/hw4\n","\n","!pip3 install --upgrade --no-deps git+https://github.com/dlsys10714/mugrade.git\n","!pip3 install pybind11"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":4376,"status":"ok","timestamp":1703484344715,"user":{"displayName":"伍嘉辉","userId":"06711267999106587498"},"user_tz":-480},"id":"hgQ8T4kLg195","outputId":"7905ed60-a524-420c-e00f-c0c38f2fa3ea"},"outputs":[{"name":"stdout","output_type":"stream","text":["-- Found pybind11: /usr/local/lib/python3.10/dist-packages/pybind11/include (found version \"2.11.1\")\n","-- Found cuda, building cuda backend\n","Mon Dec 25 06:05:40 2023       \n","+---------------------------------------------------------------------------------------+\n","| NVIDIA-SMI 535.104.05             Driver Version: 535.104.05   CUDA Version: 12.2     |\n","|-----------------------------------------+----------------------+----------------------+\n","| GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |\n","| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |\n","|                                         |                      |               MIG M. |\n","|=========================================+======================+======================|\n","|   0  Tesla T4                       Off | 00000000:00:04.0 Off |                    0 |\n","| N/A   38C    P8               9W /  70W |      0MiB / 15360MiB |      0%      Default |\n","|                                         |                      |                  N/A |\n","+-----------------------------------------+----------------------+----------------------+\n","                                                                                         \n","+---------------------------------------------------------------------------------------+\n","| Processes:                                                                            |\n","|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |\n","|        ID   ID                                                             Usage      |\n","|=======================================================================================|\n","|  No running processes found                                                           |\n","+---------------------------------------------------------------------------------------+\n","-- Autodetected CUDA architecture(s):  7.5\n","-- Configuring done (0.3s)\n","-- Generating done (0.2s)\n","-- Build files have been written to: /content/drive/Othercomputers/My MacBook Pro/hw4/build\n","make[1]: Entering directory '/content/drive/Othercomputers/My MacBook Pro/hw4/build'\n","make[2]: Entering directory '/content/drive/Othercomputers/My MacBook Pro/hw4/build'\n","make[3]: Entering directory '/content/drive/Othercomputers/My MacBook Pro/hw4/build'\n","make[3]: Leaving directory '/content/drive/Othercomputers/My MacBook Pro/hw4/build'\n","[  0%] Built target ndarray_backend_cpu\n","make[3]: Entering directory '/content/drive/Othercomputers/My MacBook Pro/hw4/build'\n","make[3]: Leaving directory '/content/drive/Othercomputers/My MacBook Pro/hw4/build'\n","make[3]: Entering directory '/content/drive/Othercomputers/My MacBook Pro/hw4/build'\n","[ 25%] \u001b[32m\u001b[1mLinking CXX shared module \"/content/drive/Othercomputers/My MacBook Pro/hw4/python/needle/backend_ndarray/ndarray_backend_cuda.cpython-310-x86_64-linux-gnu.so\"\u001b[0m\n","make[3]: Leaving directory '/content/drive/Othercomputers/My MacBook Pro/hw4/build'\n","[ 50%] Built target ndarray_backend_cuda\n","make[2]: Leaving directory '/content/drive/Othercomputers/My MacBook Pro/hw4/build'\n","make[1]: Leaving directory '/content/drive/Othercomputers/My MacBook Pro/hw4/build'\n"]}],"source":["!make"]},{"cell_type":"code","execution_count":2,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":3,"status":"ok","timestamp":1703487941306,"user":{"displayName":"伍嘉辉","userId":"06711267999106587498"},"user_tz":-480},"id":"UAdml6ozg195","outputId":"951d1c7b-a76a-4513-9766-d68a156f6a49"},"outputs":[{"name":"stdout","output_type":"stream","text":["env: PYTHONPATH=./python\n","env: NEEDLE_BACKEND=nd\n"]}],"source":["%set_env PYTHONPATH ./python\n","%set_env NEEDLE_BACKEND nd"]},{"cell_type":"code","execution_count":1,"metadata":{"executionInfo":{"elapsed":2,"status":"ok","timestamp":1703487949408,"user":{"displayName":"伍嘉辉","userId":"06711267999106587498"},"user_tz":-480},"id":"0j5HKymtg195"},"outputs":[],"source":["import sys\n","sys.path.append('./python')"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"YuSAIdx_g195","outputId":"32f7ed75-7271-4580-a164-5feb2d00086d"},"outputs":[{"name":"stdout","output_type":"stream","text":["x cifar-10-batches-py/\n","x cifar-10-batches-py/data_batch_4\n","x cifar-10-batches-py/readme.html\n","x cifar-10-batches-py/test_batch\n","x cifar-10-batches-py/data_batch_3\n","x cifar-10-batches-py/batches.meta\n","x cifar-10-batches-py/data_batch_2\n","x cifar-10-batches-py/data_batch_5\n","x cifar-10-batches-py/data_batch_1\n"]}],"source":["# Download the datasets you will be using for this assignment\n","\n","import urllib.request\n","import os\n","\n","!mkdir -p './data/ptb'\n","# Download Penn Treebank dataset\n","ptb_data = \"https://raw.githubusercontent.com/wojzaremba/lstm/master/data/ptb.\"\n","for f in ['train.txt', 'test.txt', 'valid.txt']:\n","    if not os.path.exists(os.path.join('./data/ptb', f)):\n","        urllib.request.urlretrieve(ptb_data + f, os.path.join('./data/ptb', f))\n","\n","# Download CIFAR-10 dataset\n","if not os.path.isdir(\"./data/cifar-10-batches-py\"):\n","    urllib.request.urlretrieve(\"https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz\", \"./data/cifar-10-python.tar.gz\")\n","    !tar -xvzf './data/cifar-10-python.tar.gz' -C './data'"]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"3sg0uAUvg196"},"source":["To finish setting up the assignment, go ahead and fill in all the code in `python/needle/autograd.py` using your solution code from the previous homework. Also copy the solutions in `src/ndarray_backend_cpu.cc` and `src/ndarray_backend_cuda.cu` from homework 3."]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"prT43DBBg196"},"source":["## Part 1: ND Backend [10 pts]\n","\n","Recall that in homework 2, the `array_api` was imported as `numpy`. In this part, the goal is to write the necessary operations with `array_api` imported from the needle backend `NDArray` in `python/needle/backend_ndarray/ndarray.py`. Make sure to copy the solutions for `reshape`, `permute`, `broadcast_to` and `__getitem__` from homework 3.\n","\n","Fill in the following classes in `python/needle/ops_logarithmic.py` and `python/needle/ops_mathematic.py`:\n","\n","- `PowerScalar`\n","- `EWiseDiv`\n","- `DivScalar`\n","- `Transpose`\n","- `Reshape`\n","- `BroadcastTo`\n","- `Summation`\n","- `MatMul`\n","- `Negate`\n","- `Log`\n","- `Exp`\n","- `ReLU`\n","- `LogSumExp`\n","- `Tanh` (new)\n","- `Stack` (new)\n","- `Split` (new)\n","\n","Note that for most of these, you already wrote the solutions in the previous homework and you should not change most part of your previous solution, if issues arise, please check if the `array_api` function used is supported in the needle backend.\n","\n","`TanhOp`, `Stack`, and `Split` are newly added. `Stack` concatenates same-sized tensors along a new axis, and `Split` undoes this operation. The gradients of the two operations can be written in terms of each other. We do not directly test `Split`, and only test the backward pass of `Stack` (for which we assume you used `Split`).\n","\n","**Note:** You may want to make your Summation op support sums over multiple axes; you will likely need it for the backward pass of the BroadcastTo op if yours supports broadcasting over multiple axes at a time. However, this is more about ease of use than necessity, and we leave this decision up to you (there are no corresponding tests).\n","\n","**Note:** Depending on your implementations, you may want to ensure that you call `.compact()` before reshaping arrays. (If this is necessary, you will run into corresponding error messages later in the assignment.)"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":41257,"status":"ok","timestamp":1703483774793,"user":{"displayName":"伍嘉辉","userId":"06711267999106587498"},"user_tz":-480},"id":"sRJkYppIg196","outputId":"47ab3231-a3da-49d6-b056-49f972bf2357"},"outputs":[{"name":"stdout","output_type":"stream","text":["\u001b[1m======================================= test session starts ========================================\u001b[0m\n","platform linux -- Python 3.10.12, pytest-7.4.3, pluggy-1.3.0 -- /usr/bin/python3\n","cachedir: .pytest_cache\n","rootdir: /content/drive/Othercomputers/My MacBook Pro/hw4\n","plugins: anyio-3.7.1\n","collected 1803 items / 1685 deselected / 118 selected                                              \u001b[0m\n","\n","tests/hw4/test_nd_backend.py::test_ewise_fn[cpu-shape0-divide] \u001b[32mPASSED\u001b[0m\u001b[32m                        [  0%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_ewise_fn[cpu-shape0-subtract] \u001b[32mPASSED\u001b[0m\u001b[32m                      [  1%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_ewise_fn[cpu-shape1-divide] \u001b[32mPASSED\u001b[0m\u001b[32m                        [  2%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_ewise_fn[cpu-shape1-subtract] \u001b[32mPASSED\u001b[0m\u001b[32m                      [  3%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_ewise_fn[cuda-shape0-divide] \u001b[32mPASSED\u001b[0m\u001b[32m                       [  4%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_ewise_fn[cuda-shape0-subtract] \u001b[32mPASSED\u001b[0m\u001b[32m                     [  5%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_ewise_fn[cuda-shape1-divide] \u001b[32mPASSED\u001b[0m\u001b[32m                       [  5%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_ewise_fn[cuda-shape1-subtract] \u001b[32mPASSED\u001b[0m\u001b[32m                     [  6%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_scalar_fn[cpu-shape0-divide] \u001b[32mPASSED\u001b[0m\u001b[32m                       [  7%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_scalar_fn[cpu-shape0-subtract] \u001b[32mPASSED\u001b[0m\u001b[32m                     [  8%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_scalar_fn[cpu-shape1-divide] \u001b[32mPASSED\u001b[0m\u001b[32m                       [  9%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_scalar_fn[cpu-shape1-subtract] \u001b[32mPASSED\u001b[0m\u001b[32m                     [ 10%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_scalar_fn[cuda-shape0-divide] \u001b[32mPASSED\u001b[0m\u001b[32m                      [ 11%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_scalar_fn[cuda-shape0-subtract] \u001b[32mPASSED\u001b[0m\u001b[32m                    [ 11%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_scalar_fn[cuda-shape1-divide] \u001b[32mPASSED\u001b[0m\u001b[32m                      [ 12%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_scalar_fn[cuda-shape1-subtract] \u001b[32mPASSED\u001b[0m\u001b[32m                    [ 13%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_matmul[cpu-16-16-16] \u001b[32mPASSED\u001b[0m\u001b[32m                               [ 14%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_matmul[cpu-8-8-8] \u001b[32mPASSED\u001b[0m\u001b[32m                                  [ 15%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_matmul[cpu-1-2-3] \u001b[32mPASSED\u001b[0m\u001b[32m                                  [ 16%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_matmul[cpu-3-4-5] \u001b[32mPASSED\u001b[0m\u001b[32m                                  [ 16%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_matmul[cpu-5-4-3] \u001b[32mPASSED\u001b[0m\u001b[32m                                  [ 17%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_matmul[cpu-16-16-32] \u001b[32mPASSED\u001b[0m\u001b[32m                               [ 18%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_matmul[cpu-64-64-64] \u001b[32mPASSED\u001b[0m\u001b[32m                               [ 19%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_matmul[cpu-72-72-72] \u001b[32mPASSED\u001b[0m\u001b[32m                               [ 20%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_matmul[cpu-72-73-74] \u001b[32mPASSED\u001b[0m\u001b[32m                               [ 21%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_matmul[cpu-74-73-72] \u001b[32mPASSED\u001b[0m\u001b[32m                               [ 22%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_matmul[cpu-128-128-128] \u001b[32mPASSED\u001b[0m\u001b[32m                            [ 22%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_matmul[cuda-16-16-16] \u001b[32mPASSED\u001b[0m\u001b[32m                              [ 23%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_matmul[cuda-8-8-8] \u001b[32mPASSED\u001b[0m\u001b[32m                                 [ 24%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_matmul[cuda-1-2-3] \u001b[32mPASSED\u001b[0m\u001b[32m                                 [ 25%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_matmul[cuda-3-4-5] \u001b[32mPASSED\u001b[0m\u001b[32m                                 [ 26%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_matmul[cuda-5-4-3] \u001b[32mPASSED\u001b[0m\u001b[32m                                 [ 27%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_matmul[cuda-16-16-32] \u001b[32mPASSED\u001b[0m\u001b[32m                              [ 27%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_matmul[cuda-64-64-64] \u001b[32mPASSED\u001b[0m\u001b[32m                              [ 28%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_matmul[cuda-72-72-72] \u001b[32mPASSED\u001b[0m\u001b[32m                              [ 29%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_matmul[cuda-72-73-74] \u001b[32mPASSED\u001b[0m\u001b[32m                              [ 30%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_matmul[cuda-74-73-72] \u001b[32mPASSED\u001b[0m\u001b[32m                              [ 31%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_matmul[cuda-128-128-128] \u001b[32mPASSED\u001b[0m\u001b[32m                           [ 32%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_power[cpu-shape0] \u001b[32mPASSED\u001b[0m\u001b[32m                                  [ 33%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_power[cpu-shape1] \u001b[32mPASSED\u001b[0m\u001b[32m                                  [ 33%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_power[cuda-shape0] \u001b[32mPASSED\u001b[0m\u001b[32m                                 [ 34%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_power[cuda-shape1] \u001b[32mPASSED\u001b[0m\u001b[32m                                 [ 35%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_log[cpu-shape0] \u001b[32mPASSED\u001b[0m\u001b[32m                                    [ 36%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_log[cpu-shape1] \u001b[32mPASSED\u001b[0m\u001b[32m                                    [ 37%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_log[cuda-shape0] \u001b[32mPASSED\u001b[0m\u001b[32m                                   [ 38%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_log[cuda-shape1] \u001b[32mPASSED\u001b[0m\u001b[32m                                   [ 38%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_exp[cpu-shape0] \u001b[32mPASSED\u001b[0m\u001b[32m                                    [ 39%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_exp[cpu-shape1] \u001b[32mPASSED\u001b[0m\u001b[32m                                    [ 40%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_exp[cuda-shape0] \u001b[32mPASSED\u001b[0m\u001b[32m                                   [ 41%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_exp[cuda-shape1] \u001b[32mPASSED\u001b[0m\u001b[32m                                   [ 42%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_relu[cpu-shape0] \u001b[32mPASSED\u001b[0m\u001b[32m                                   [ 43%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_relu[cpu-shape1] \u001b[32mPASSED\u001b[0m\u001b[32m                                   [ 44%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_relu[cuda-shape0] \u001b[32mPASSED\u001b[0m\u001b[32m                                  [ 44%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_relu[cuda-shape1] \u001b[32mPASSED\u001b[0m\u001b[32m                                  [ 45%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_tanh[cpu-shape0] \u001b[32mPASSED\u001b[0m\u001b[32m                                   [ 46%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_tanh[cpu-shape1] \u001b[32mPASSED\u001b[0m\u001b[32m                                   [ 47%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_tanh[cuda-shape0] \u001b[32mPASSED\u001b[0m\u001b[32m                                  [ 48%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_tanh[cuda-shape1] \u001b[32mPASSED\u001b[0m\u001b[32m                                  [ 49%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_tanh_backward[cpu-shape0] \u001b[32mPASSED\u001b[0m\u001b[32m                          [ 50%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_tanh_backward[cpu-shape1] \u001b[32mPASSED\u001b[0m\u001b[32m                          [ 50%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_tanh_backward[cuda-shape0] \u001b[32mPASSED\u001b[0m\u001b[32m                         [ 51%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_tanh_backward[cuda-shape1] \u001b[32mPASSED\u001b[0m\u001b[32m                         [ 52%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_stack[cpu-shape0-0-1] \u001b[32mPASSED\u001b[0m\u001b[32m                              [ 53%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_stack[cpu-shape1-0-2] \u001b[32mPASSED\u001b[0m\u001b[32m                              [ 54%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_stack[cpu-shape2-2-5] \u001b[32mPASSED\u001b[0m\u001b[32m                              [ 55%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_stack[cuda-shape0-0-1] \u001b[32mPASSED\u001b[0m\u001b[32m                             [ 55%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_stack[cuda-shape1-0-2] \u001b[32mPASSED\u001b[0m\u001b[32m                             [ 56%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_stack[cuda-shape2-2-5] \u001b[32mPASSED\u001b[0m\u001b[32m                             [ 57%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_stack_backward[cpu-shape0-0-1] \u001b[32mPASSED\u001b[0m\u001b[32m                     [ 58%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_stack_backward[cpu-shape1-0-2] \u001b[32mPASSED\u001b[0m\u001b[32m                     [ 59%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_stack_backward[cpu-shape2-2-5] \u001b[32mPASSED\u001b[0m\u001b[32m                     [ 60%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_stack_backward[cuda-shape0-0-1] \u001b[32mPASSED\u001b[0m\u001b[32m                    [ 61%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_stack_backward[cuda-shape1-0-2] \u001b[32mPASSED\u001b[0m\u001b[32m                    [ 61%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_stack_backward[cuda-shape2-2-5] \u001b[32mPASSED\u001b[0m\u001b[32m                    [ 62%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_summation[cpu-shape0-None] \u001b[32mPASSED\u001b[0m\u001b[32m                         [ 63%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_summation[cpu-shape1-0] \u001b[32mPASSED\u001b[0m\u001b[32m                            [ 64%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_summation[cpu-shape2-1] \u001b[32mPASSED\u001b[0m\u001b[32m                            [ 65%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_summation[cpu-shape3-2] \u001b[32mPASSED\u001b[0m\u001b[32m                            [ 66%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_summation[cuda-shape0-None] \u001b[32mPASSED\u001b[0m\u001b[32m                        [ 66%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_summation[cuda-shape1-0] \u001b[32mPASSED\u001b[0m\u001b[32m                           [ 67%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_summation[cuda-shape2-1] \u001b[32mPASSED\u001b[0m\u001b[32m                           [ 68%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_summation[cuda-shape3-2] \u001b[32mPASSED\u001b[0m\u001b[32m                           [ 69%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_summation_backward[cpu-shape0-None] \u001b[32mPASSED\u001b[0m\u001b[32m                [ 70%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_summation_backward[cpu-shape1-0] \u001b[32mPASSED\u001b[0m\u001b[32m                   [ 71%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_summation_backward[cpu-shape2-1] \u001b[32mPASSED\u001b[0m\u001b[32m                   [ 72%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_summation_backward[cpu-shape3-2] \u001b[32mPASSED\u001b[0m\u001b[32m                   [ 72%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_summation_backward[cuda-shape0-None] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 73%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_summation_backward[cuda-shape1-0] \u001b[32mPASSED\u001b[0m\u001b[32m                  [ 74%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_summation_backward[cuda-shape2-1] \u001b[32mPASSED\u001b[0m\u001b[32m                  [ 75%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_summation_backward[cuda-shape3-2] \u001b[32mPASSED\u001b[0m\u001b[32m                  [ 76%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_broadcast_to[cpu-shape0-shape_to0] \u001b[32mPASSED\u001b[0m\u001b[32m                 [ 77%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_broadcast_to[cpu-shape1-shape_to1] \u001b[32mPASSED\u001b[0m\u001b[32m                 [ 77%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_broadcast_to[cuda-shape0-shape_to0] \u001b[32mPASSED\u001b[0m\u001b[32m                [ 78%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_broadcast_to[cuda-shape1-shape_to1] \u001b[32mPASSED\u001b[0m\u001b[32m                [ 79%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_reshape[cpu-shape0-shape_to0] \u001b[32mPASSED\u001b[0m\u001b[32m                      [ 80%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_reshape[cpu-shape1-shape_to1] \u001b[32mPASSED\u001b[0m\u001b[32m                      [ 81%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_reshape[cuda-shape0-shape_to0] \u001b[32mPASSED\u001b[0m\u001b[32m                     [ 82%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_reshape[cuda-shape1-shape_to1] \u001b[32mPASSED\u001b[0m\u001b[32m                     [ 83%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_transpose[cpu-axes0-shape0] \u001b[32mPASSED\u001b[0m\u001b[32m                        [ 83%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_transpose[cpu-axes0-shape1] \u001b[32mPASSED\u001b[0m\u001b[32m                        [ 84%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_transpose[cpu-axes1-shape0] \u001b[32mPASSED\u001b[0m\u001b[32m                        [ 85%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_transpose[cpu-axes1-shape1] \u001b[32mPASSED\u001b[0m\u001b[32m                        [ 86%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_transpose[cpu-None-shape0] \u001b[32mPASSED\u001b[0m\u001b[32m                         [ 87%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_transpose[cpu-None-shape1] \u001b[32mPASSED\u001b[0m\u001b[32m                         [ 88%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_transpose[cuda-axes0-shape0] \u001b[32mPASSED\u001b[0m\u001b[32m                       [ 88%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_transpose[cuda-axes0-shape1] \u001b[32mPASSED\u001b[0m\u001b[32m                       [ 89%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_transpose[cuda-axes1-shape0] \u001b[32mPASSED\u001b[0m\u001b[32m                       [ 90%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_transpose[cuda-axes1-shape1] \u001b[32mPASSED\u001b[0m\u001b[32m                       [ 91%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_transpose[cuda-None-shape0] \u001b[32mPASSED\u001b[0m\u001b[32m                        [ 92%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_transpose[cuda-None-shape1] \u001b[32mPASSED\u001b[0m\u001b[32m                        [ 93%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_logsumexp[cpu-shape0-None] \u001b[32mPASSED\u001b[0m\u001b[32m                         [ 94%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_logsumexp[cpu-shape1-0] \u001b[32mPASSED\u001b[0m\u001b[32m                            [ 94%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_logsumexp[cpu-shape2-1] \u001b[32mPASSED\u001b[0m\u001b[32m                            [ 95%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_logsumexp[cpu-shape3-2] \u001b[32mPASSED\u001b[0m\u001b[32m                            [ 96%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_logsumexp[cuda-shape0-None] \u001b[32mPASSED\u001b[0m\u001b[32m                        [ 97%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_logsumexp[cuda-shape1-0] \u001b[32mPASSED\u001b[0m\u001b[32m                           [ 98%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_logsumexp[cuda-shape2-1] \u001b[32mPASSED\u001b[0m\u001b[32m                           [ 99%]\u001b[0m\n","tests/hw4/test_nd_backend.py::test_logsumexp[cuda-shape3-2] \u001b[32mPASSED\u001b[0m\u001b[32m                           [100%]\u001b[0m\n","\n","\u001b[32m============================== \u001b[32m\u001b[1m118 passed\u001b[0m, \u001b[33m1685 deselected\u001b[0m\u001b[32m in 36.00s\u001b[0m\u001b[32m ===============================\u001b[0m\n"]}],"source":["!python3 -m pytest -l -v -k \"nd_backend\""]},{"cell_type":"code","execution_count":null,"metadata":{"id":"RIR_7KPSg196"},"outputs":[],"source":["!python3 -m mugrade submit \"YOUR KEY HERE\" -k \"new_nd_backend\""]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"z885B6s1g196"},"source":["## Part 2: CIFAR-10 dataset [10 points]\n","\n","Next, you will write support for the [CIFAR-10](https://www.cs.toronto.edu/~kriz/cifar.html) image classification dataset, which consists of 60,000 32x32 color images in 10 classes, with 6,000 images per class. There are 50k training images and 10k test images.\n","\n","Start by implementing the `__init__` function in the `CIFAR10Dataset` class in `python/needle/data/datasets/cifar10_dataset.py`. You can read in the link above how to properly read the CIFAR-10 dataset files you downloaded at the beginning of the homework. Also fill in `__getitem__` and `__len__`. Note that the return shape of the data from `__getitem__` should be in order (3, 32, 32).\n","\n","Copy `python/needle/data/data_transforms.py` and `python/needle/data/data_basic.py` from previous homeworks."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":33218,"status":"ok","timestamp":1703483820281,"user":{"displayName":"伍嘉辉","userId":"06711267999106587498"},"user_tz":-480},"id":"5FsU7vxDg196","outputId":"340631d3-2aa7-40ab-a19d-223a6f15b7ea"},"outputs":[{"name":"stdout","output_type":"stream","text":["\u001b[1m======================================= test session starts ========================================\u001b[0m\n","platform linux -- Python 3.10.12, pytest-7.4.3, pluggy-1.3.0 -- /usr/bin/python3\n","cachedir: .pytest_cache\n","rootdir: /content/drive/Othercomputers/My MacBook Pro/hw4\n","plugins: anyio-3.7.1\n","collected 1803 items / 1793 deselected / 10 selected                                               \u001b[0m\n","\n","tests/hw4/test_cifar_ptb_data.py::test_cifar10_dataset[True] \u001b[32mPASSED\u001b[0m\u001b[32m                          [ 10%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_cifar10_dataset[False] \u001b[32mPASSED\u001b[0m\u001b[32m                         [ 20%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_cifar10_loader[cpu-True-1] \u001b[32mPASSED\u001b[0m\u001b[32m                     [ 30%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_cifar10_loader[cpu-True-15] \u001b[32mPASSED\u001b[0m\u001b[32m                    [ 40%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_cifar10_loader[cpu-False-1] \u001b[32mPASSED\u001b[0m\u001b[32m                    [ 50%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_cifar10_loader[cpu-False-15] \u001b[32mPASSED\u001b[0m\u001b[32m                   [ 60%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_cifar10_loader[cuda-True-1] \u001b[32mPASSED\u001b[0m\u001b[32m                    [ 70%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_cifar10_loader[cuda-True-15] \u001b[32mPASSED\u001b[0m\u001b[32m                   [ 80%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_cifar10_loader[cuda-False-1] \u001b[32mPASSED\u001b[0m\u001b[32m                   [ 90%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_cifar10_loader[cuda-False-15] \u001b[32mPASSED\u001b[0m\u001b[32m                  [100%]\u001b[0m\n","\n","\u001b[32m=============================== \u001b[32m\u001b[1m10 passed\u001b[0m, \u001b[33m1793 deselected\u001b[0m\u001b[32m in 31.89s\u001b[0m\u001b[32m ===============================\u001b[0m\n"]}],"source":["!python3 -m pytest -l -v -k \"test_cifar10\""]},{"cell_type":"code","execution_count":null,"metadata":{"id":"M_Q2Phfbg197"},"outputs":[],"source":["!python3 -m mugrade submit \"YOUR KEY HERE\" -k \"cifar10\""]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"QZ6a8FSng197","tags":[]},"source":["## Part 3: Convolutional neural network [40 points]\n","\n","Here's an outline of what you will do in this task.\n","\n","In `python/needle/backend_ndarray/ndarray.py`, implement:\n","- `flip`\n","- `pad`\n","\n","In `python/needle/ops_mathematic.py`, implement (forward and backward):\n","- `Flip`\n","- `Dilate`\n","- `UnDilate`\n","- `Conv`\n","\n","In `python/needle/nn/nn_conv.py`, implement:\n","- `Conv`\n","\n","In `apps/models.py`, fill in the `ResNet9` class.  \n","\n","In `apps/simple_ml.py`, fill in:\n","- `epoch_general_cifar10`,\n","- `train_cifar10`\n","- `evaluate_cifar10`\n","\n","We have provided a `BatchNorm2d` implementation in `python/needle/nn/nn_basic.py` for you as a wrapper around your previous `BatchNorm1d` implementation.\n","\n","**Note**: Remember to copy the solution of `nn_basic.py` from previous homework, make sure to not overwrite the `BatchNorm2d` module."]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"iJeXGWp6g197"},"source":["### Padding ndarrays\n","\n","Convolution as typically implemented in deep learning libraries cuts down the size of inputs;\n","e.g., a (1, 32, 32, 3) image convolved with a 3x3 filter would give a (1, 30, 30, c) output.\n","A way around this is to pad the input ndarray before performing convolution, e.g., pad with zeros to get a (1, 34, 34, 3) ndarray so that the result is (1, 32, 32, 3).\n","\n","Padding is also required for the backward pass of convolution.\n","\n","You should implement `pad` in `ndarray.py` to closely reflect the behavior of `np.pad`.\n","That is, `pad` should take a tuple of 2-tuples with length equal to the number of dimensions of the array,\n","where each element in the 2-tuple corresponds to \"left padding\" and \"right padding\", respectively.\n","\n","For example, if `A` is a (10, 32, 32, 8) ndarray (think NHWC), then `A.pad( (0, 0), (2, 2), (2, 2), (0, 0) )` would be a (10, 36, 36, 8) ndarray where the \"spatial\" dimension has been padded by two zeros on all sides."]},{"cell_type":"code","execution_count":null,"metadata":{"id":"1zTFleMdg197","outputId":"f0dd524a-9fea-4d89-ea7f-0801206623a6"},"outputs":[{"name":"stdout","output_type":"stream","text":["\u001b[1m============================= test session starts ==============================\u001b[0m\n","platform darwin -- Python 3.10.9, pytest-7.1.2, pluggy-1.0.0 -- /Users/jiahuiwu/anaconda3/bin/python3\n","cachedir: .pytest_cache\n","rootdir: /Users/jiahuiwu/Library/Mobile Documents/com~apple~CloudDocs/计算机知识/CMU 10-414 Deep Learning Systems/hw4\n","plugins: anyio-3.5.0\n","collected 1803 items / 1801 deselected / 2 selected                            \u001b[0m\u001b[1m\n","\n","tests/hw4/test_conv.py::test_pad_forward[params0-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 50%]\u001b[0m\n","tests/hw4/test_conv.py::test_pad_forward[params1-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [100%]\u001b[0m\n","\n","\u001b[32m====================== \u001b[32m\u001b[1m2 passed\u001b[0m, \u001b[33m1801 deselected\u001b[0m\u001b[32m in 2.00s\u001b[0m\u001b[32m ======================\u001b[0m\n"]}],"source":["!python3 -m pytest -l -v -k \"pad_forward\""]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"pUp7vhQwg197"},"source":["-------------------------------------"]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"49M2TYBjg197"},"source":["### Flipping ndarrays & FlipOp"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"2gWgHDTpg198"},"outputs":[],"source":["import numpy as np\n","import ctypes"]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"o9tnZ-Odg198"},"source":["Some utility code for a demonstration below which you can probably ignore. It might be instructive to check out the `offset` function."]},{"cell_type":"code","execution_count":null,"metadata":{"id":"NG_QKyO0g198"},"outputs":[],"source":["# reads off the underlying data array in order (i.e., offset 0, offset 1, ..., offset n)\n","# i.e., ignoring strides\n","def raw_data(X):\n","    X = np.array(X) # copy, thus compact X\n","    return np.frombuffer(ctypes.string_at(X.ctypes.data, X.nbytes), dtype=X.dtype, count=X.size)\n","\n","# Xold and Xnew should reference the same underlying data\n","def offset(Xold, Xnew):\n","    assert Xold.itemsize == Xnew.itemsize\n","    # compare addresses to the beginning of the arrays\n","    return (Xnew.ctypes.data - Xold.ctypes.data)//Xnew.itemsize\n","\n","def strides(X):\n","    return ', '.join([str(x//X.itemsize) for x in X.strides])\n","\n","def format_array(X, shape):\n","    assert len(shape) == 3, \"I only made this formatting work for ndims = 3\"\n","    def chunks(l, n):\n","        n = max(1, n)\n","        return (l[i:i+n] for i in range(0, len(l), n))\n","    a = [str(x) if x >= 10 else ' ' + str(x) for x in X]\n","    a = ['(' + ' '.join(y) + ')' for y in [x for x in chunks(a, shape[-1])]]\n","    a = ['|' + ' '.join(y) + '|' for y in [x for x in chunks(a, shape[-2])]]\n","    return '  '.join(a)\n","\n","def inspect_array(X, *, is_a_copy_of):\n","    # compacts X, then reads it off in order\n","    print('Data: %s' % format_array(raw_data(X), X.shape))\n","    # compares address of X to copy_of, thus finding X's offset\n","    print('Offset: %s' % offset(is_a_copy_of, X))\n","    print('Strides: %s' % strides(X))"]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"TTDQ7NJjg198","tags":[]},"source":["In order to implement the backwards pass of 2D convolution, we will (probably) need a function which _flips_\n","axes of ndarrays. We say \"probably\" because you could probably cleverly implement your convolution forward\n","function to avoid this. However, we think it is easiest to think about this if you have the ability to \"flip\" the kernel along its vertical and horizontal dimensions.\n","\n","We will try to build up your intuition for the \"flip\" operation below in order to help you figure out how to implement it in `ndarray.py`. To do that, we explore numpy's `np.flip` function below. One thing to note is that\n","`flip` is typically implemented by using negative strides and changing the _offset_ of the underlying array.\n","\n","For example, flipping an array on _all_ of its axes is equivalent to reversing the array. In this case, you can imagine that we would want all the strides to be negative, and the offset to be the length of the array (to start at the end of the array and \"stride\" backwards).\n","\n","Since we did not explicitly support negative strides in our implementation for the last homework, we will merely call `NDArray.make` with them to make our \"flipped\" array and then immediately call `.compact()`. Other than changing unsigned ints to signed ints in a few places, we suspect your existing `compact` function should not have to change at all to accomodate negative strides. In the .cc and .cu files we distributed, we have already changed the function signatures to reflect this.\n","\n","Alternatively, you could simply implement `flip` in the CPU backend by copying memory, which you _may_ find more intuitive. We suggest following our mini tutorial below to keep your implementation Python-focused, since we believe it is involves approximately the same amount of effort to implement it slightly more naively in C."]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"1zoXNzk_g198"},"source":["Use this array as reference for the other examples:"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"xXNgtsN3g198","outputId":"f926f491-4b8f-4162-9966-6c6c358124c6"},"outputs":[{"name":"stdout","output_type":"stream","text":["Data: |( 1  2  3  4) ( 5  6  7  8)|  |( 9 10 11 12) (13 14 15 16)|  |(17 18 19 20) (21 22 23 24)|\n","Offset: 0\n","Strides: 8, 4, 1\n"]}],"source":["A = np.arange(1, 25).reshape(3, 2, 4)\n","inspect_array(A, is_a_copy_of=A)"]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"7gcqjJJog199"},"source":["We have put brackets around each axis of the array. Notice that for this array, the offset is 0 and the strides are all positive."]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"i_FrP2Xtg199"},"source":["----------------------------------------------------------"]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"1uuQ0Vv4g199"},"source":["See what happens when you flip the array along the last axis below.\n","Note that the `inspect_array` function compacts the array after flipping it so you can see the\n","\"logical\" order of the data, and the offset is calculated by comparing the address of the **non**-compacted\n","flipped array with that of `is_copy_of`, i.e., the array `A` we looked at above.\n","\n","That is, we are looking at how numpy calculates the strides and offset for flipped arrays in order\n","to copy this behavior in our own implementation."]},{"cell_type":"code","execution_count":null,"metadata":{"id":"NCdi8V9Sg199","outputId":"6abdaf48-d27c-44d2-da31-906a72eda1e2"},"outputs":[{"name":"stdout","output_type":"stream","text":["Data: |( 4  3  2  1) ( 8  7  6  5)|  |(12 11 10  9) (16 15 14 13)|  |(20 19 18 17) (24 23 22 21)|\n","Offset: 3\n","Strides: 8, 4, -1\n"]}],"source":["inspect_array(np.flip(A, (2,)), is_a_copy_of=A)"]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"2s9Z3Wrdg199"},"source":["So flipping the last axis reverses the order of the elements within each 4-dimensional \"cell\", as you can see above. The stride corresponding to the axis we flipped has been negated. And the offset is 3 -- this makes sense, e.g., because we want the new \"first\" element of the array to be 4, which was at index 3 in `A`."]},{"cell_type":"code","execution_count":null,"metadata":{"id":"SdpKGonbg199","outputId":"33a266ad-9559-405f-d6c2-0a1448923ce4"},"outputs":[{"name":"stdout","output_type":"stream","text":["Data: |( 5  6  7  8) ( 1  2  3  4)|  |(13 14 15 16) ( 9 10 11 12)|  |(21 22 23 24) (17 18 19 20)|\n","Offset: 4\n","Strides: 8, -4, 1\n"]}],"source":["inspect_array(np.flip(A, (1,)), is_a_copy_of=A)"]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"YrB9luCdg19-"},"source":["Again for the middle axis: we negate the middle stride, and the offset is 4, which seems reasonable since we now want the first element to be 5, which was at index 4 in the original array `A`."]},{"cell_type":"code","execution_count":null,"metadata":{"id":"fEOb_Pegg19-","outputId":"1fe09561-50f9-4a1a-a715-25ef38789342"},"outputs":[{"name":"stdout","output_type":"stream","text":["Data: |(17 18 19 20) (21 22 23 24)|  |( 9 10 11 12) (13 14 15 16)|  |( 1  2  3  4) ( 5  6  7  8)|\n","Offset: 16\n","Strides: -8, 4, 1\n"]}],"source":["inspect_array(np.flip(A, (0,)), is_a_copy_of=A)"]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"ygZT2zqfg19-"},"source":["Try to infer the more general algorithm for computing the offset given the axis to flip."]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"cc7JgFHUg19-"},"source":["----------------------------------------------------------------------------------------------------------"]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"VHR1pf-Lg19-"},"source":["Observe what happens when we flip _all_ axes."]},{"cell_type":"code","execution_count":null,"metadata":{"id":"3uqO3S8cg19_","outputId":"6c591901-c714-4860-bf92-4857b6f91ebf"},"outputs":[{"name":"stdout","output_type":"stream","text":["Data: |(24 23 22 21) (20 19 18 17)|  |(16 15 14 13) (12 11 10  9)|  |( 8  7  6  5) ( 4  3  2  1)|\n","Offset: 23\n","Strides: -8, -4, -1\n"]}],"source":["inspect_array(np.flip(A, (0,1,2)), is_a_copy_of=A)"]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"mBKIBY-Pg1-A"},"source":["As mentioned earlier, the offset is then sufficient to point to the last element of the array, and this is just the \"reverse order\" version of `A`."]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"ej0Xky88g1-A"},"source":["When we flip just axes 1 and 0..."]},{"cell_type":"code","execution_count":null,"metadata":{"id":"I_xxah_1g1-B","outputId":"4aa58b23-4a31-40b2-c9c3-ac809ab1e2d8"},"outputs":[{"name":"stdout","output_type":"stream","text":["Data: |(21 22 23 24) (17 18 19 20)|  |(13 14 15 16) ( 9 10 11 12)|  |( 5  6  7  8) ( 1  2  3  4)|\n","Offset: 20\n","Strides: -8, -4, 1\n"]}],"source":["inspect_array(np.flip(A, (0,1)), is_a_copy_of=A)"]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"-c88ZrF-g1-B"},"source":["The offset is 20. Looking back on our previous offset computations, do you notice something?"]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"Ja4mGn5Dg1-B"},"source":["-------------------\n","\n","With this exploration of numpy's ndarray flipping functionality, which uses negative strides and a custom offset,\n","try to implement `flip` in `ndarray.py`. You also must implement \"flip\" forward and backward functions in `ops.py`; note that these should be extremely short.\n","\n","**Important:** You should call NDArray.make with the new strides and offset, and then immediately `.compact()` this array. The resulting array is then copied and has positive strides. We want this (less-than-optimal) behavior because we did not account for negative strides in our previous implementation. _Aside:_ If you want, consider where/if negative strides break your implementation. `__getitem__` definitely doesn't work due to how we processed slices; is there anything else? (_Note_: this isn't graded.)\n","\n","Also, if you want to instead add a `flip` operator on the CPU/CUDA backends, that's also okay.\n","\n"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":6330,"status":"ok","timestamp":1703483839921,"user":{"displayName":"伍嘉辉","userId":"06711267999106587498"},"user_tz":-480},"id":"79Wn9lmbg1-B","outputId":"51ee6c63-a260-4cc6-ad40-2a59bed18804"},"outputs":[{"name":"stdout","output_type":"stream","text":["\u001b[1m======================================= test session starts ========================================\u001b[0m\n","platform linux -- Python 3.10.12, pytest-7.4.3, pluggy-1.3.0 -- /usr/bin/python3\n","cachedir: .pytest_cache\n","rootdir: /content/drive/Othercomputers/My MacBook Pro/hw4\n","plugins: anyio-3.7.1\n","collected 1803 items / 1763 deselected / 40 selected                                               \u001b[0m\n","\n","tests/hw4/test_conv.py::test_flip_forward[params0-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [  2%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_forward[params0-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [  5%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_forward[params1-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [  7%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_forward[params1-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 10%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_forward[params2-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 12%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_forward[params2-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 15%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_forward[params3-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 17%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_forward[params3-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 20%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_forward[params4-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 22%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_forward[params4-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 25%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_forward[params5-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 27%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_forward[params5-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 30%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_forward[params6-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 32%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_forward[params6-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 35%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_forward[params7-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 37%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_forward[params7-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 40%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_forward[params8-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 42%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_forward[params8-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 45%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_forward[params9-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 47%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_forward[params9-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 50%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_backward[params0-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 52%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_backward[params0-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 55%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_backward[params1-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 57%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_backward[params1-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 60%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_backward[params2-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 62%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_backward[params2-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 65%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_backward[params3-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 67%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_backward[params3-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 70%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_backward[params4-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 72%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_backward[params4-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 75%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_backward[params5-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 77%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_backward[params5-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 80%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_backward[params6-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 82%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_backward[params6-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 85%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_backward[params7-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 87%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_backward[params7-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 90%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_backward[params8-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 92%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_backward[params8-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 95%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_backward[params9-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 97%]\u001b[0m\n","tests/hw4/test_conv.py::test_flip_backward[params9-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [100%]\u001b[0m\n","\n","\u001b[32m=============================== \u001b[32m\u001b[1m40 passed\u001b[0m, \u001b[33m1763 deselected\u001b[0m\u001b[32m in 4.33s\u001b[0m\u001b[32m ================================\u001b[0m\n"]}],"source":["!python3 -m pytest -l -v -k \"flip\""]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"1Pg-7Ujeg1-C"},"source":["-------------------------------------"]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"-wxrSvuxg1-C"},"source":["### Dilation\n"]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"5ZvjImfzg1-C"},"source":["The dilation operator puts zeros between elements of an ndarray. We will need it for computing the backward pass of convolution when the stride of the convolution is greater than 1. As an example, dilation should do the following to a 2x2 matrix when dilated by 1 on both axes:\n","\n","$$\n","\\begin{bmatrix}\n","1 & 2 \\\\\n","3 & 4\n","\\end{bmatrix}\n","\\Longrightarrow\n","\\begin{bmatrix}\n","1 & 0 & 2 & 0 \\\\\n","0 & 0 & 0 & 0 \\\\\n","3 & 0 & 4 & 0 \\\\\n","0 & 0 & 0 & 0\n","\\end{bmatrix}\n","$$\n","\n","To get some intuition for why we need dilation for the backward pass of strided convolution, consider a  `stride=2`, `padding=\"same\"`, `input_channels=output_channels=8` convolution applied to an input of size (10, 32, 32, 8). The resulting output will be of size (10, 16, 16, 8) due to the stride, and thus `out_grad` will have shape (10, 16, 16, 8). Yet, the gradient of the input needs to, of course, have shape (10, 32, 32, 8) -- so we must need to increase the size of `out_grad` in some way. Consider also that you could implement strided convolution as `Conv(x)[:, ::2, ::2, :]`, i.e., only keeping every other pixel in the spatial dimension.\n","\n","\n","Implement `Dilate` in `ops.py`. This function takes two additional parameters (in attrs): the `dilation` amount and the `axes` to dilate. You must also implement the corresponding op `UnDilate`, whose forward pass will be used to implement the gradient of `Dilate`. (This is so we do not have to implement `GetItem` and `SetItem` ops, which can be highly inefficient to backprop through without additional optimizations.)"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":4703,"status":"ok","timestamp":1703483848403,"user":{"displayName":"伍嘉辉","userId":"06711267999106587498"},"user_tz":-480},"id":"PdI1UUQMg1-C","outputId":"17496d72-4701-41c2-a211-b72147b2eb53"},"outputs":[{"name":"stdout","output_type":"stream","text":["\u001b[1m======================================= test session starts ========================================\u001b[0m\n","platform linux -- Python 3.10.12, pytest-7.4.3, pluggy-1.3.0 -- /usr/bin/python3\n","cachedir: .pytest_cache\n","rootdir: /content/drive/Othercomputers/My MacBook Pro/hw4\n","plugins: anyio-3.7.1\n","collected 1803 items / 1777 deselected / 26 selected                                               \u001b[0m\n","\n","tests/hw4/test_conv.py::test_dilate_forward[needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [  3%]\u001b[0m\n","tests/hw4/test_conv.py::test_dilate_forward[needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [  7%]\u001b[0m\n","tests/hw4/test_conv.py::test_dilate_backward[params0-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 11%]\u001b[0m\n","tests/hw4/test_conv.py::test_dilate_backward[params0-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 15%]\u001b[0m\n","tests/hw4/test_conv.py::test_dilate_backward[params1-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 19%]\u001b[0m\n","tests/hw4/test_conv.py::test_dilate_backward[params1-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 23%]\u001b[0m\n","tests/hw4/test_conv.py::test_dilate_backward[params2-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 26%]\u001b[0m\n","tests/hw4/test_conv.py::test_dilate_backward[params2-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 30%]\u001b[0m\n","tests/hw4/test_conv.py::test_dilate_backward[params3-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 34%]\u001b[0m\n","tests/hw4/test_conv.py::test_dilate_backward[params3-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 38%]\u001b[0m\n","tests/hw4/test_conv.py::test_dilate_backward[params4-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 42%]\u001b[0m\n","tests/hw4/test_conv.py::test_dilate_backward[params4-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 46%]\u001b[0m\n","tests/hw4/test_conv.py::test_dilate_backward[params5-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 50%]\u001b[0m\n","tests/hw4/test_conv.py::test_dilate_backward[params5-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 53%]\u001b[0m\n","tests/hw4/test_conv.py::test_dilate_backward[params6-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 57%]\u001b[0m\n","tests/hw4/test_conv.py::test_dilate_backward[params6-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 61%]\u001b[0m\n","tests/hw4/test_conv.py::test_dilate_backward[params7-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 65%]\u001b[0m\n","tests/hw4/test_conv.py::test_dilate_backward[params7-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 69%]\u001b[0m\n","tests/hw4/test_conv.py::test_dilate_backward[params8-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 73%]\u001b[0m\n","tests/hw4/test_conv.py::test_dilate_backward[params8-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 76%]\u001b[0m\n","tests/hw4/test_conv.py::test_dilate_backward[params9-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 80%]\u001b[0m\n","tests/hw4/test_conv.py::test_dilate_backward[params9-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 84%]\u001b[0m\n","tests/hw4/test_conv.py::test_dilate_backward[params10-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 88%]\u001b[0m\n","tests/hw4/test_conv.py::test_dilate_backward[params10-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [ 92%]\u001b[0m\n","tests/hw4/test_conv.py::test_dilate_backward[params11-needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 96%]\u001b[0m\n","tests/hw4/test_conv.py::test_dilate_backward[params11-needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [100%]\u001b[0m\n","\n","\u001b[32m=============================== \u001b[32m\u001b[1m26 passed\u001b[0m, \u001b[33m1777 deselected\u001b[0m\u001b[32m in 3.31s\u001b[0m\u001b[32m ================================\u001b[0m\n"]}],"source":["!python3 -m pytest -l -v -k \"dilate\""]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"h-x2-mZEg1-D"},"source":["---------------------------------------"]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"LrG4HAiTg1-D"},"source":["### Submit new ops (flip/dilation) to mugrade [10 points]"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"ldIQHRV5g1-E"},"outputs":[],"source":["!python3 -m mugrade submit \"YOUR KEY HERE\" -k \"new_ops\""]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"9ddhlCtng1-E"},"source":["-----------------"]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"TMorFB51g1-G"},"source":["### Convolution forward\n","\n","Implement the forward pass of 2D multi-channel convolution in `ops.py`. You should probably refer to [this notebook](https://github.com/dlsyscourse/public_notebooks/blob/main/convolution_implementation.ipynb) from lecture, which implements 2D multi-channel convolution using im2col in numpy.\n","\n","**Note:** Your convolution op should accept tensors in the NHWC format, as in the example above, and weights in the format (kernel_size, kernel_size, input_channels, output_channels).\n","\n","However, you will need to add two additional features. Your convolution function should accept arguments for `padding` (default 0) and `stride` (default 1). For `padding`, you should simply apply your padding function to the spatial dimensions (i.e., axes 1 and 2).\n","\n","Implementing strided convolution should consist of a relatively small set of changes to your plain convolution implementation.\n","\n","We recommend implementing convolution without stride first, ensuring you pass some of the tests below, and then adding in stride."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":4095,"status":"ok","timestamp":1703483858366,"user":{"displayName":"伍嘉辉","userId":"06711267999106587498"},"user_tz":-480},"id":"0NP-FBaGg1-G","outputId":"47b9a6d2-ffa6-4e05-bd4c-aebf7b9318d9"},"outputs":[{"name":"stdout","output_type":"stream","text":["\u001b[1m======================================= test session starts ========================================\u001b[0m\n","platform linux -- Python 3.10.12, pytest-7.4.3, pluggy-1.3.0 -- /usr/bin/python3\n","cachedir: .pytest_cache\n","rootdir: /content/drive/Othercomputers/My MacBook Pro/hw4\n","plugins: anyio-3.7.1\n","collected 1803 items / 1769 deselected / 34 selected                                               \u001b[0m\n","\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape0-W_shape0-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [  2%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape1-W_shape1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  5%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape2-W_shape2-1-2] \u001b[32mPASSED\u001b[0m\u001b[32m [  8%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape3-W_shape3-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 11%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape4-W_shape4-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 14%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape5-W_shape5-2-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 17%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape6-W_shape6-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 20%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape7-W_shape7-2-2] \u001b[32mPASSED\u001b[0m\u001b[32m [ 23%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape8-W_shape8-2-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 26%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape9-W_shape9-2-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 29%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape10-W_shape10-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 32%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape11-W_shape11-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 35%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape12-W_shape12-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 38%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape13-W_shape13-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 41%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape14-W_shape14-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 44%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape15-W_shape15-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 47%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape16-W_shape16-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 50%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape0-W_shape0-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 52%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape1-W_shape1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 55%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape2-W_shape2-1-2] \u001b[32mPASSED\u001b[0m\u001b[32m [ 58%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape3-W_shape3-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 61%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape4-W_shape4-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 64%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape5-W_shape5-2-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 67%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape6-W_shape6-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 70%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape7-W_shape7-2-2] \u001b[32mPASSED\u001b[0m\u001b[32m [ 73%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape8-W_shape8-2-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 76%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape9-W_shape9-2-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 79%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape10-W_shape10-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 82%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape11-W_shape11-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 85%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape12-W_shape12-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 88%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape13-W_shape13-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 91%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape14-W_shape14-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 94%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape15-W_shape15-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 97%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[forward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape16-W_shape16-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [100%]\u001b[0m\n","\n","\u001b[32m=============================== \u001b[32m\u001b[1m34 passed\u001b[0m, \u001b[33m1769 deselected\u001b[0m\u001b[32m in 2.73s\u001b[0m\u001b[32m ================================\u001b[0m\n"]}],"source":["!python3 -m pytest -l -v -k \"op_conv and forward\""]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"jvgL7wS1g1-G"},"source":["-----------------"]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"E5QhFAXVg1-H"},"source":["### Convolution backward"]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"uk3wua91g1-H"},"source":["Finding the gradients of 2D multi-channel convolution can be technically quite challenging (especially \"rigorously\"). We will try to provide some useful hints here. Basically, we encourage you to make use of the surprising fact that _whatever makes the dimensions work out is typically right_.\n","\n","Ultimately, the backward pass of convolution can be done in terms of the convolution operator itself, with some clever manipulations using `flip`, `dilate`, and multiple applications of `transpose` to both the arguments and the results.\n","\n","In the last section, we essentially implemented convolution as a matrix product: ignoring the various restride and reshape operations, we basically have something like `X @ W`, where `X` is the input and `W` is the weight. We also have `out_grad`, which is the same shape as `X @ W`. Now, you have already implemented the backward pass of matrix multiplication in a previous assignment, and we can use this knowledge to get some insight into the backward pass of convolution. In particular, referencing your matmul backward implementation, you may notice (heuristically speaking here):\n","\n","`X.grad = out_grad @ W.transpose` \\\n","`W.grad = X.transpose @ out_grad`\n","\n","Surprisingly enough, things work out if we just assume that these are also convolutions (and now assuming that `out_grad`, `W`, and `X` are tensors amenable to 2D multi-channel convolution instead of matrices):\n","\n","`X.grad = ≈conv(≈out_grad, ≈W)` \\\n","`W.grad = ≈conv(≈X, ≈out_grad)`\n","\n","In which the \"≈\" indicates that you need to apply some additional operators to these terms in order to get the dimensions to work out, such as permuting/transposing axes, dilating, changing the `padding=` argument to the convolution function, or permuting/transposing axes of the resulting convolution.\n","\n","As we saw on the [last few slides here](https://dlsyscourse.org/slides/conv_nets.pdf) in class, the transpose of a convolution can be found by simply flipping the kernel. Since we're working in 2D instead of 1D, this means flipping the kernel both vertically and horizontally (thus why we implemented `flip`).\n","\n","Summarizing some hints for both `X.grad` and `W.grad`:\n","\n","`X.grad`\n","- The convolution of `out_grad` and `W`, with some operations applied to those\n","- `W` should be flipped over both the kernel dimensions\n","- If the convolution is strided, increase the size of `out_grad` with a corresponding dilation\n","- Do an example to analyze dimensions: note the shape you want for `X.grad`, and think about how you must permute/transpose the arguments and add padding to the convolution to achieve this shape\n","    - This padding depends on both the kernel size and the `padding` argument to the convolution\n","\n","`W.grad`\n","- The convolution of `X` and `out_grad`, with some operations applied to those\n","- The gradients of `W` must be accumulated over the batches; how can you make the conv operator itself do this accumulation?\n","    - Consider turning batches into channels via transpose/permute\n","- Analyze dimensions: how can you modify `X` and `out_grad` so that the shape of their convolution matches the shape of `W`? You may need to transpose/permute the result.\n","    - Remember to account for the `padding` argument passed to convolution\n","\n","General tips\n","- Deal with strided convolutions last (you should be able to just drop in `dilate` when you've passed most of the tests)\n","- Start with the case where `padding=0`, then consider changing `padding` arguments\n","- You can \"permute\" axes with multiple calls to `transpose`\n","\n","It might also be useful to skip ahead to nn.Conv, pass the forward tests, and then use both the tests below and the nn.Conv backward tests to debug your implementation."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":4214,"status":"ok","timestamp":1703483869488,"user":{"displayName":"伍嘉辉","userId":"06711267999106587498"},"user_tz":-480},"id":"e9bjgB0mg1-H","outputId":"1f417da7-3d31-411b-f396-123af47e804f"},"outputs":[{"name":"stdout","output_type":"stream","text":["\u001b[1m======================================= test session starts ========================================\u001b[0m\n","platform linux -- Python 3.10.12, pytest-7.4.3, pluggy-1.3.0 -- /usr/bin/python3\n","cachedir: .pytest_cache\n","rootdir: /content/drive/Othercomputers/My MacBook Pro/hw4\n","plugins: anyio-3.7.1\n","collected 1803 items / 1769 deselected / 34 selected                                               \u001b[0m\n","\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape0-W_shape0-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [  2%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape1-W_shape1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  5%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape2-W_shape2-1-2] \u001b[32mPASSED\u001b[0m\u001b[32m [  8%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape3-W_shape3-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 11%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape4-W_shape4-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 14%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape5-W_shape5-2-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 17%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape6-W_shape6-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 20%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape7-W_shape7-2-2] \u001b[32mPASSED\u001b[0m\u001b[32m [ 23%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape8-W_shape8-2-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 26%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape9-W_shape9-2-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 29%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape10-W_shape10-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 32%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape11-W_shape11-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 35%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape12-W_shape12-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 38%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape13-W_shape13-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 41%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape14-W_shape14-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 44%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape15-W_shape15-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 47%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cpu-Z_shape16-W_shape16-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 50%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape0-W_shape0-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 52%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape1-W_shape1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 55%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape2-W_shape2-1-2] \u001b[32mPASSED\u001b[0m\u001b[32m [ 58%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape3-W_shape3-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 61%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape4-W_shape4-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 64%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape5-W_shape5-2-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 67%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape6-W_shape6-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 70%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape7-W_shape7-2-2] \u001b[32mPASSED\u001b[0m\u001b[32m [ 73%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape8-W_shape8-2-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 76%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape9-W_shape9-2-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 79%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape10-W_shape10-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 82%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape11-W_shape11-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 85%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape12-W_shape12-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 88%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape13-W_shape13-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 91%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape14-W_shape14-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 94%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape15-W_shape15-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [ 97%]\u001b[0m\n","tests/hw4/test_conv.py::test_op_conv[backward-needle.backend_ndarray.ndarray_backend_cuda-Z_shape16-W_shape16-1-0] \u001b[32mPASSED\u001b[0m\u001b[32m [100%]\u001b[0m\n","\n","\u001b[32m=============================== \u001b[32m\u001b[1m34 passed\u001b[0m, \u001b[33m1769 deselected\u001b[0m\u001b[32m in 2.99s\u001b[0m\u001b[32m ================================\u001b[0m\n"]}],"source":["!python3 -m pytest -l -v -k \"op_conv and backward\""]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"fc4R39wWg1-H"},"source":["-----------------"]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"cLMAd1IXg1-H"},"source":["### nn.Conv"]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"_8rbit_tg1-H","tags":[]},"source":["#### Fixing init._calculate_fans for convolution\n","Previously, we have implemented Kaiming uniform/normal initializations, where we essentially assigned `fan_in = input_size` and `fan_out = output_size`.\n","For convolution, this becomes somewhat more detailed, in that you should multiply both of these by the \"receptive field size\", which is in this case just the product of the kernel sizes -- which in our case are always going to be the same, i.e., $k\\times k$ kernels.\n","\n","**You will need to edit your `kaiming_uniform` in `python/needle/init/init_initializers.py`, etc. init functions to support multidimensional arrays.** In particular, it should support a new `shape` argument which is then passed to, e.g., the underlying `rand` function. Specifically, if the argument `shape` is not None, then ignore `fan_in` and `fan_out` but use the value of `shape` for initializations.\n","\n","You can test this below; though it is not _directly_ graded, it must match ours to pass the nn.Conv mugrade tests."]},{"cell_type":"code","execution_count":null,"metadata":{"id":"AGAG2uizg1-I","outputId":"12886fff-07ae-439e-f2f1-7c82158191f3"},"outputs":[{"name":"stdout","output_type":"stream","text":["\u001b[1m============================= test session starts ==============================\u001b[0m\n","platform darwin -- Python 3.10.9, pytest-7.1.2, pluggy-1.0.0 -- /Users/jiahuiwu/anaconda3/bin/python3\n","cachedir: .pytest_cache\n","rootdir: /Users/jiahuiwu/Library/Mobile Documents/com~apple~CloudDocs/计算机知识/CMU 10-414 Deep Learning Systems/homework_for_github/hw4\n","plugins: anyio-3.5.0\n","collected 1803 items / 1801 deselected / 2 selected                            \u001b[0m\u001b[1m\n","\n","tests/hw4/test_conv.py::test_init_kaiming_uniform[needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 50%]\u001b[0m\n","tests/hw4/test_conv.py::test_init_kaiming_uniform[device1] \u001b[33mSKIPPED\u001b[0m (...)\u001b[32m [100%]\u001b[0m\n","\n","\u001b[32m================ \u001b[32m\u001b[1m1 passed\u001b[0m, \u001b[33m1 skipped\u001b[0m, \u001b[33m1801 deselected\u001b[0m\u001b[32m in 2.45s\u001b[0m\u001b[32m =================\u001b[0m\n"]}],"source":["!python3 -m pytest -l -v -k \"kaiming_uniform\""]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"vF4j-R1Tg1-I"},"source":["#### Implementing nn.Conv\n","\n","Essentially, nn.Conv is just a wrapper of the convolution operator we previously implemented\n","which adds a bias term, initializes the weight and bias, and ensures that the padding is set so that the input and output dimensions are the same (in the `stride=1` case, anyways).\n","\n","Importantly, nn.Conv should support NCHW format instead of NHWC format. In particular, we think this makes more sense given our current BatchNorm implementation. You can implement this by applying `transpose` twice to both the input and output.  \n","\n","- Ensure nn.Conv works for (N, C, H, W) tensors even though we implemented the conv op for (N, H, W, C) tensors\n","- Initialize the (k, k, i, o) weight tensor using Kaiming uniform initialization with default settings\n","- Initialize the (o,) bias tensor using uniform initialization on the interval $\\pm$`1.0/(in_channels * kernel_size**2)**0.5`\n","- Calculate the appropriate padding to ensure input and output dimensions are the same\n","- Calculate the convolution, then add the properly-broadcasted bias term if present\n","\n","You can now test your nn.Conv against PyTorch's nn.Conv2d with the two PyTest calls below."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":5231,"status":"ok","timestamp":1703483880445,"user":{"displayName":"伍嘉辉","userId":"06711267999106587498"},"user_tz":-480},"id":"-fCP0RgBg1-I","outputId":"46fe18f5-56e1-4077-fce2-9155d0d03483"},"outputs":[{"name":"stdout","output_type":"stream","text":["\u001b[1m======================================= test session starts ========================================\u001b[0m\n","platform linux -- Python 3.10.12, pytest-7.4.3, pluggy-1.3.0 -- /usr/bin/python3\n","cachedir: .pytest_cache\n","rootdir: /content/drive/Othercomputers/My MacBook Pro/hw4\n","plugins: anyio-3.7.1\n","collected 1803 items / 1793 deselected / 10 selected                                               \u001b[0m\n","\n","tests/hw4/test_conv.py::test_nn_conv_forward[needle.backend_ndarray.ndarray_backend_cpu-4-8-16-3-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 10%]\u001b[0m\n","tests/hw4/test_conv.py::test_nn_conv_forward[needle.backend_ndarray.ndarray_backend_cpu-32-8-16-3-2] \u001b[32mPASSED\u001b[0m\u001b[32m [ 20%]\u001b[0m\n","tests/hw4/test_conv.py::test_nn_conv_forward[needle.backend_ndarray.ndarray_backend_cpu-32-8-8-3-2] \u001b[32mPASSED\u001b[0m\u001b[32m [ 30%]\u001b[0m\n","tests/hw4/test_conv.py::test_nn_conv_forward[needle.backend_ndarray.ndarray_backend_cpu-32-16-8-3-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 40%]\u001b[0m\n","tests/hw4/test_conv.py::test_nn_conv_forward[needle.backend_ndarray.ndarray_backend_cpu-32-16-8-3-2] \u001b[32mPASSED\u001b[0m\u001b[32m [ 50%]\u001b[0m\n","tests/hw4/test_conv.py::test_nn_conv_forward[needle.backend_ndarray.ndarray_backend_cuda-4-8-16-3-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 60%]\u001b[0m\n","tests/hw4/test_conv.py::test_nn_conv_forward[needle.backend_ndarray.ndarray_backend_cuda-32-8-16-3-2] \u001b[32mPASSED\u001b[0m\u001b[32m [ 70%]\u001b[0m\n","tests/hw4/test_conv.py::test_nn_conv_forward[needle.backend_ndarray.ndarray_backend_cuda-32-8-8-3-2] \u001b[32mPASSED\u001b[0m\u001b[32m [ 80%]\u001b[0m\n","tests/hw4/test_conv.py::test_nn_conv_forward[needle.backend_ndarray.ndarray_backend_cuda-32-16-8-3-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 90%]\u001b[0m\n","tests/hw4/test_conv.py::test_nn_conv_forward[needle.backend_ndarray.ndarray_backend_cuda-32-16-8-3-2] \u001b[32mPASSED\u001b[0m\u001b[32m [100%]\u001b[0m\n","\n","\u001b[32m=============================== \u001b[32m\u001b[1m10 passed\u001b[0m, \u001b[33m1793 deselected\u001b[0m\u001b[32m in 4.03s\u001b[0m\u001b[32m ================================\u001b[0m\n"]}],"source":["!python3 -m pytest -l -v -k \"nn_conv_forward\""]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":4135,"status":"ok","timestamp":1703483889924,"user":{"displayName":"伍嘉辉","userId":"06711267999106587498"},"user_tz":-480},"id":"eaEkXyxxg1-I","outputId":"c642d7c4-a9cc-498b-f821-19e87da69d4d"},"outputs":[{"name":"stdout","output_type":"stream","text":["\u001b[1m======================================= test session starts ========================================\u001b[0m\n","platform linux -- Python 3.10.12, pytest-7.4.3, pluggy-1.3.0 -- /usr/bin/python3\n","cachedir: .pytest_cache\n","rootdir: /content/drive/Othercomputers/My MacBook Pro/hw4\n","plugins: anyio-3.7.1\n","collected 1803 items / 1789 deselected / 14 selected                                               \u001b[0m\n","\n","tests/hw4/test_conv.py::test_nn_conv_backward[needle.backend_ndarray.ndarray_backend_cpu-4-1-1-3-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  7%]\u001b[0m\n","tests/hw4/test_conv.py::test_nn_conv_backward[needle.backend_ndarray.ndarray_backend_cpu-14-8-16-3-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 14%]\u001b[0m\n","tests/hw4/test_conv.py::test_nn_conv_backward[needle.backend_ndarray.ndarray_backend_cpu-14-8-16-3-2] \u001b[32mPASSED\u001b[0m\u001b[32m [ 21%]\u001b[0m\n","tests/hw4/test_conv.py::test_nn_conv_backward[needle.backend_ndarray.ndarray_backend_cpu-14-8-8-3-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 28%]\u001b[0m\n","tests/hw4/test_conv.py::test_nn_conv_backward[needle.backend_ndarray.ndarray_backend_cpu-14-8-8-3-2] \u001b[32mPASSED\u001b[0m\u001b[32m [ 35%]\u001b[0m\n","tests/hw4/test_conv.py::test_nn_conv_backward[needle.backend_ndarray.ndarray_backend_cpu-14-16-8-3-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 42%]\u001b[0m\n","tests/hw4/test_conv.py::test_nn_conv_backward[needle.backend_ndarray.ndarray_backend_cpu-14-16-8-3-2] \u001b[32mPASSED\u001b[0m\u001b[32m [ 50%]\u001b[0m\n","tests/hw4/test_conv.py::test_nn_conv_backward[needle.backend_ndarray.ndarray_backend_cuda-4-1-1-3-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 57%]\u001b[0m\n","tests/hw4/test_conv.py::test_nn_conv_backward[needle.backend_ndarray.ndarray_backend_cuda-14-8-16-3-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 64%]\u001b[0m\n","tests/hw4/test_conv.py::test_nn_conv_backward[needle.backend_ndarray.ndarray_backend_cuda-14-8-16-3-2] \u001b[32mPASSED\u001b[0m\u001b[32m [ 71%]\u001b[0m\n","tests/hw4/test_conv.py::test_nn_conv_backward[needle.backend_ndarray.ndarray_backend_cuda-14-8-8-3-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 78%]\u001b[0m\n","tests/hw4/test_conv.py::test_nn_conv_backward[needle.backend_ndarray.ndarray_backend_cuda-14-8-8-3-2] \u001b[32mPASSED\u001b[0m\u001b[32m [ 85%]\u001b[0m\n","tests/hw4/test_conv.py::test_nn_conv_backward[needle.backend_ndarray.ndarray_backend_cuda-14-16-8-3-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 92%]\u001b[0m\n","tests/hw4/test_conv.py::test_nn_conv_backward[needle.backend_ndarray.ndarray_backend_cuda-14-16-8-3-2] \u001b[32mPASSED\u001b[0m\u001b[32m [100%]\u001b[0m\n","\n","\u001b[32m=============================== \u001b[32m\u001b[1m14 passed\u001b[0m, \u001b[33m1789 deselected\u001b[0m\u001b[32m in 3.84s\u001b[0m\u001b[32m ================================\u001b[0m\n"]}],"source":["!python3 -m pytest -l -v -k \"nn_conv_backward\""]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"YW6vLjFNg1-I"},"source":["-----------------"]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"3FEu26lzg1-J"},"source":["### Submit nn.Conv to mugrade [20 points]"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"cW-u9E4Yg1-J"},"outputs":[],"source":["!python3 -m mugrade submit \"YOUR KEY HERE\" -k \"conv_forward\""]},{"cell_type":"code","execution_count":null,"metadata":{"id":"Cd9TiMNog1-J"},"outputs":[],"source":["!python3 -m mugrade submit \"YOUR KEY HERE\" -k \"conv_backward\""]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"-VrbNWgzg1-J"},"source":["------------------------------------------------"]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"NIUORPeag1-J","tags":[]},"source":["### Implementing \"ResNet9\""]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"yZ3d1B1ig1-K"},"source":["You will now use your convolutional layer to implement a model similar to _ResNet9_, which is known to be a reasonable model for getting good accuracy on CIFAR-10 quickly (see [here](https://github.com/davidcpage/cifar10-fast)). Our main change is that we used striding instead of pooling and divided all of the channels by 4 for the sake of performance (as our framework is not as well-optimized as industry-grade frameworks).\n","\n","In the figure below, before the linear layer, you should \"flatten\" the tensor. You can use the module `Flatten` in `nn_basic.py`, or you can simply use `.reshape` in the `forward()` method of your ResNet9.\n","\n","Make sure that you pass the device to all modules in your model; otherwise, you will get errors about mismatched devices when trying to run with CUDA.\n","\n","<center><img src=\"https://github.com/dlsyscourse/hw4/blob/main/ResNet9.png?raw=true\" alt=\"ResNet9\" style=\"width: 400px;\" /></center>\n","\n","We have tried to make it easier to pass the tests here than for previous assignments where you have implemented models. In particular, we are just going to make sure it has the right number of parameters and similar accuracy and loss after 1 or 2 batches of CIFAR-10."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":4704,"status":"ok","timestamp":1703484400165,"user":{"displayName":"伍嘉辉","userId":"06711267999106587498"},"user_tz":-480},"id":"Msp3_cJeg1-K","outputId":"af323533-0036-4a57-d6c2-516b60fa1711","tags":[]},"outputs":[{"name":"stdout","output_type":"stream","text":["\u001b[1m======================================= test session starts ========================================\u001b[0m\n","platform linux -- Python 3.10.12, pytest-7.4.3, pluggy-1.3.0 -- /usr/bin/python3\n","cachedir: .pytest_cache\n","rootdir: /content/drive/Othercomputers/My MacBook Pro/hw4\n","plugins: anyio-3.7.1\n","collected 1803 items / 1801 deselected / 2 selected                                                \u001b[0m\n","\n","tests/hw4/test_conv.py::test_resnet9[needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m      [ 50%]\u001b[0m\n","tests/hw4/test_conv.py::test_resnet9[needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m     [100%]\u001b[0m\n","\n","\u001b[32m================================ \u001b[32m\u001b[1m2 passed\u001b[0m, \u001b[33m1801 deselected\u001b[0m\u001b[32m in 3.25s\u001b[0m\u001b[32m ================================\u001b[0m\n"]}],"source":["!python3 -m pytest -l -v -k \"resnet9\""]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"jPz6-aVMg1-K"},"source":["Now we can train a ResNet on CIFAR10: (remember to copy the solutions in `python/needle/optim.py` from previous homeworks)"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":13004,"status":"ok","timestamp":1703484614269,"user":{"displayName":"伍嘉辉","userId":"06711267999106587498"},"user_tz":-480},"id":"r3uneq0cg1-K","outputId":"13175b49-a934-4888-cd6a-e974b069d750"},"outputs":[{"name":"stdout","output_type":"stream","text":["\u001b[1m======================================= test session starts ========================================\u001b[0m\n","platform linux -- Python 3.10.12, pytest-7.4.3, pluggy-1.3.0 -- /usr/bin/python3\n","cachedir: .pytest_cache\n","rootdir: /content/drive/Othercomputers/My MacBook Pro/hw4\n","plugins: anyio-3.7.1\n","collected 1803 items / 1801 deselected / 2 selected                                                \u001b[0m\n","\n","tests/hw4/test_conv.py::test_train_cifar10[needle.backend_ndarray.ndarray_backend_cpu] \u001b[32mPASSED\u001b[0m\u001b[32m [ 50%]\u001b[0m\n","tests/hw4/test_conv.py::test_train_cifar10[needle.backend_ndarray.ndarray_backend_cuda] \u001b[32mPASSED\u001b[0m\u001b[32m [100%]\u001b[0m\n","\n","\u001b[32m=============================== \u001b[32m\u001b[1m2 passed\u001b[0m, \u001b[33m1801 deselected\u001b[0m\u001b[32m in 10.52s\u001b[0m\u001b[32m ================================\u001b[0m\n"]}],"source":["!python3 -m pytest -l -v -k \"train_cifar10\""]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"Kt69CENng1-K"},"source":["### Submit ResNet9 to mugrade [10 points]"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"TDHphd4lg1-L"},"outputs":[],"source":["!python3 -m mugrade submit \"YOUR KEY HERE\" -k \"resnet9\""]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"0vduLRusg1-L"},"source":["-----------------"]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"jnAZh6q4g1-L"},"source":["Now, you can train your model on CIFAR-10 using the following code. Note that this is likely going to be quite slow, and also  not all that accurate due to the lack of data augmentation. You should expect it to take around 500s per epoch."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":408},"executionInfo":{"elapsed":60713,"status":"error","timestamp":1703488130937,"user":{"displayName":"伍嘉辉","userId":"06711267999106587498"},"user_tz":-480},"id":"mIOJjvY3g1-L","outputId":"08250750-1864-45c0-a570-ecaeb7c4e5f7"},"outputs":[],"source":["import sys\n","sys.path.append('./python')\n","sys.path.append('./apps')\n","import needle as ndl\n","from models import ResNet9\n","from simple_ml import train_cifar10, evaluate_cifar10\n","\n","device = ndl.cpu()\n","dataset = ndl.data.CIFAR10Dataset(\"data/cifar-10-batches-py\", train=True)\n","dataloader = ndl.data.DataLoader(\\\n","         dataset=dataset,\n","         batch_size=128,\n","         shuffle=True,)\n","model = ResNet9(device=device, dtype=\"float32\")\n","train_cifar10(model, dataloader, n_epochs=10, optimizer=ndl.optim.Adam,\n","      lr=0.001, weight_decay=0.001, device=device)\n","evaluate_cifar10(model, dataloader)"]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"eCDk_Zo5g1-M"},"source":["## Part 4: Recurrent neural network [10 points]\n","\n","**Note:** In the following sections, you may find yourself wanting to index into tensors, i.e., to use getitem or setitem. However, we have not implemented these for tensors in our library; instead, you should use `stack` and `split` operations.\n","\n","In `python/needle/nn_sequence.py`, implement `RNNCell`.\n","\n","$h^\\prime = \\text{tanh}(xW_{ih} + b_{ih} + hW_{hh} + b_{hh})$. If nonlinearity is 'relu', then ReLU is used in place of tanh.\n","\n","All weights and biases should be initialized from $\\mathcal{U}(-\\sqrt{k}, \\sqrt{k})$ where $k=\\frac{1}{\\text{hidden_size}}$.\n","\n","In `python/needle/nn_sequence.py`, implement `RNN`.\n","\n","For each element in the input sequence, each layer computes the following function:\n","\n","$h_t = \\text{tanh}(x_tW_{ih} + b_{ih} + h_{(t-1)}W_{hh} + b_{hh})$\n","\n","where $h_t$ is the hidden state at time $t$, $x_t$ is the input at time $t$, and $h_{(t-1)}$ is the hidden state of the previous layer at time $t-1$ or the initial hidden state at time $0$. If nonlinearity is 'relu', then ReLU is used in place of tanh.\n","\n","In a multi-layer RNN, the input $x_t^{(l)}$ of the $l$-th layer ($l \\ge 2$) is the hidden state $h_t^{(l-1)}$ of the previous layer.\n"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":17674,"status":"ok","timestamp":1703485848714,"user":{"displayName":"伍嘉辉","userId":"06711267999106587498"},"user_tz":-480},"id":"vtfoQ_BEg1-M","outputId":"e1b9cc33-bd74-4f30-add3-f71103e53d93"},"outputs":[{"name":"stdout","output_type":"stream","text":["\u001b[1m======================================= test session starts ========================================\u001b[0m\n","platform linux -- Python 3.10.12, pytest-7.4.3, pluggy-1.3.0 -- /usr/bin/python3\n","cachedir: .pytest_cache\n","rootdir: /content/drive/Othercomputers/My MacBook Pro/hw4\n","plugins: anyio-3.7.1\n","collected 1803 items / 1163 deselected / 640 selected                                              \u001b[0m\n","\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-True-True-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [  0%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-True-True-1-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m           [  0%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-True-True-1-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [  0%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-True-True-1-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m          [  0%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-True-True-12-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [  0%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-True-True-12-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m          [  0%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-True-True-12-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [  1%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-True-True-12-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m         [  1%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-True-False-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [  1%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-True-False-1-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m          [  1%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-True-False-1-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [  1%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-True-False-1-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m         [  1%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-True-False-12-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [  2%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-True-False-12-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m         [  2%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-True-False-12-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [  2%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-True-False-12-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m        [  2%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-False-True-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [  2%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-False-True-1-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m          [  2%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-False-True-1-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [  2%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-False-True-1-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m         [  3%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-False-True-12-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [  3%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-False-True-12-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m         [  3%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-False-True-12-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [  3%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-False-True-12-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m        [  3%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-False-False-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [  3%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-False-False-1-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m         [  4%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-False-False-1-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [  4%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-False-False-1-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m        [  4%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-False-False-12-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [  4%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-False-False-12-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m        [  4%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-False-False-12-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [  4%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-tanh-False-False-12-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m       [  5%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-True-True-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [  5%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-True-True-1-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m           [  5%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-True-True-1-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [  5%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-True-True-1-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m          [  5%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-True-True-12-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [  5%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-True-True-12-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m          [  5%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-True-True-12-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [  6%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-True-True-12-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m         [  6%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-True-False-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [  6%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-True-False-1-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m          [  6%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-True-False-1-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [  6%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-True-False-1-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m         [  6%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-True-False-12-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [  7%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-True-False-12-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m         [  7%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-True-False-12-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [  7%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-True-False-12-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m        [  7%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-False-True-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [  7%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-False-True-1-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m          [  7%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-False-True-1-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [  7%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-False-True-1-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m         [  8%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-False-True-12-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [  8%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-False-True-12-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m         [  8%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-False-True-12-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [  8%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-False-True-12-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m        [  8%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-False-False-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [  8%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-False-False-1-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m         [  9%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-False-False-1-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [  9%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-False-False-1-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m        [  9%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-False-False-12-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [  9%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-False-False-12-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m        [  9%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-False-False-12-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [  9%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cpu-relu-False-False-12-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 10%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-True-True-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 10%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-True-True-1-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 10%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-True-True-1-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 10%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-True-True-1-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 10%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-True-True-12-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 10%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-True-True-12-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 10%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-True-True-12-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 11%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-True-True-12-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 11%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-True-False-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 11%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-True-False-1-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 11%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-True-False-1-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 11%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-True-False-1-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 11%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-True-False-12-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 12%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-True-False-12-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 12%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-True-False-12-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 12%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-True-False-12-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 12%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-False-True-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 12%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-False-True-1-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 12%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-False-True-1-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 12%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-False-True-1-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 13%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-False-True-12-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 13%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-False-True-12-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 13%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-False-True-12-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 13%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-False-True-12-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 13%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-False-False-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 13%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-False-False-1-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 14%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-False-False-1-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 14%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-False-False-1-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 14%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-False-False-12-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 14%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-False-False-12-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 14%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-False-False-12-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 14%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-tanh-False-False-12-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m      [ 15%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-True-True-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 15%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-True-True-1-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 15%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-True-True-1-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 15%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-True-True-1-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 15%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-True-True-12-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 15%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-True-True-12-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 15%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-True-True-12-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 16%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-True-True-12-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 16%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-True-False-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 16%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-True-False-1-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 16%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-True-False-1-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 16%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-True-False-1-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 16%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-True-False-12-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 17%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-True-False-12-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 17%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-True-False-12-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 17%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-True-False-12-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 17%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-False-True-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 17%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-False-True-1-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 17%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-False-True-1-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 17%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-False-True-1-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 18%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-False-True-12-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 18%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-False-True-12-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 18%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-False-True-12-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 18%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-False-True-12-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 18%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-False-False-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 18%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-False-False-1-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 19%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-False-False-1-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 19%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-False-False-1-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 19%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-False-False-12-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 19%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-False-False-12-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 19%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-False-False-12-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 19%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn_cell[cuda-relu-False-False-12-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m      [ 20%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 20%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 20%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 20%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 20%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 20%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 20%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 21%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 21%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-1-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 21%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-1-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 21%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-1-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 21%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-1-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 21%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-1-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 22%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-1-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 22%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-1-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 22%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-1-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 22%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 22%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 22%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 22%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 23%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 23%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 23%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 23%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 23%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-12-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 23%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-12-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 24%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-12-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 24%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-12-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 24%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-12-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 24%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-12-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 24%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-12-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 24%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-True-12-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 25%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 25%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 25%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 25%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 25%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 25%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 25%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 26%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 26%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-1-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 26%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-1-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 26%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-1-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 26%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-1-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 26%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-1-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 27%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-1-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 27%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-1-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 27%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-1-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 27%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 27%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 27%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 27%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 28%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 28%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 28%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 28%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 28%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-12-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 28%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-12-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 29%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-12-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 29%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-12-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 29%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-12-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 29%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-12-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 29%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-12-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 29%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-True-False-12-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 30%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 30%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 30%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 30%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 30%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 30%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 30%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 31%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 31%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-1-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 31%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-1-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 31%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-1-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 31%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-1-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 31%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-1-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 32%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-1-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 32%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-1-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 32%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-1-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 32%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 32%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 32%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 32%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 33%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 33%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 33%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 33%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 33%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-12-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 33%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-12-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 34%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-12-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 34%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-12-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 34%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-12-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 34%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-12-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 34%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-12-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 34%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-True-12-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 35%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 35%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 35%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 35%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 35%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 35%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 35%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 36%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 36%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-1-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 36%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-1-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 36%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-1-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 36%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-1-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 36%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-1-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 37%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-1-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 37%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-1-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 37%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-1-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 37%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 37%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 37%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 37%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 38%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 38%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 38%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 38%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 38%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-12-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 38%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-12-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 39%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-12-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 39%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-12-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 39%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-12-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 39%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-12-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 39%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-12-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 39%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-tanh-False-False-12-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 40%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 40%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 40%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 40%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 40%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 40%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 40%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 41%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 41%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-1-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 41%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-1-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 41%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-1-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 41%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-1-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 41%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-1-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 42%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-1-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 42%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-1-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 42%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-1-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 42%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 42%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 42%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 42%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 43%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 43%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 43%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 43%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 43%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-12-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 43%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-12-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 44%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-12-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 44%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-12-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 44%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-12-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 44%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-12-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 44%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-12-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 44%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-True-12-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 45%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 45%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 45%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 45%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 45%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 45%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 45%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 46%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 46%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-1-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 46%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-1-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 46%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-1-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 46%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-1-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 46%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-1-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 47%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-1-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 47%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-1-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 47%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-1-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 47%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 47%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 47%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 47%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 48%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 48%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 48%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 48%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 48%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-12-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 48%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-12-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 49%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-12-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 49%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-12-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 49%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-12-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 49%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-12-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 49%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-12-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 49%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-True-False-12-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 50%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 50%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 50%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 50%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 50%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 50%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 50%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 51%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 51%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-1-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 51%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-1-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 51%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-1-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 51%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-1-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 51%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-1-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 52%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-1-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 52%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-1-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 52%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-1-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 52%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 52%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 52%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 52%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 53%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 53%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 53%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 53%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 53%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-12-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 53%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-12-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 54%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-12-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 54%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-12-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 54%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-12-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 54%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-12-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 54%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-12-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 54%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-True-12-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 55%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 55%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 55%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 55%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 55%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 55%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 55%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 56%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 56%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-1-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 56%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-1-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 56%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-1-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 56%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-1-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 56%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-1-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 57%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-1-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 57%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-1-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 57%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-1-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 57%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 57%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 57%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 57%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 58%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 58%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 58%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 58%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 58%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-12-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 58%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-12-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 59%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-12-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 59%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-12-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 59%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-12-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 59%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-12-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 59%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-12-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 59%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cpu-relu-False-False-12-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 60%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 60%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 60%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 60%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 60%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 60%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 60%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 61%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 61%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-1-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 61%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-1-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 61%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-1-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 61%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-1-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 61%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-1-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 62%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-1-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 62%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-1-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 62%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-1-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 62%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 62%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 62%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 62%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 63%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 63%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 63%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 63%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 63%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-12-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 63%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-12-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 64%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-12-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 64%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-12-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 64%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-12-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 64%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-12-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 64%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-12-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 64%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-True-12-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 65%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 65%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 65%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 65%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 65%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 65%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 65%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 66%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 66%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-1-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 66%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-1-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 66%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-1-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 66%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-1-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 66%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-1-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 67%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-1-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 67%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-1-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 67%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-1-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 67%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 67%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 67%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 67%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 68%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 68%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 68%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 68%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 68%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-12-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 68%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-12-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 69%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-12-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 69%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-12-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 69%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-12-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 69%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-12-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 69%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-12-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 69%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-True-False-12-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 70%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 70%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 70%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 70%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 70%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 70%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 70%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 71%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 71%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-1-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 71%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-1-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 71%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-1-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 71%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-1-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 71%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-1-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 72%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-1-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 72%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-1-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 72%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-1-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 72%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 72%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 72%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 72%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 73%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 73%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 73%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 73%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 73%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-12-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 73%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-12-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 74%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-12-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 74%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-12-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 74%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-12-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 74%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-12-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 74%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-12-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 74%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-True-12-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 75%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 75%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 75%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 75%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 75%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 75%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 75%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 76%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 76%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-1-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 76%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-1-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 76%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-1-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 76%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-1-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 76%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-1-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 77%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-1-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 77%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-1-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 77%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-1-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 77%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 77%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 77%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 77%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 78%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 78%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 78%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 78%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 78%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-12-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 78%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-12-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 79%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-12-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 79%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-12-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 79%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-12-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 79%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-12-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m      [ 79%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-12-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 79%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-tanh-False-False-12-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m      [ 80%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 80%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 80%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 80%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 80%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 80%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 80%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 81%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 81%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-1-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 81%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-1-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 81%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-1-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 81%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-1-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 81%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-1-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 82%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-1-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 82%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-1-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 82%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-1-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 82%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 82%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 82%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 82%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 83%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 83%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 83%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 83%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 83%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-12-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 83%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-12-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 84%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-12-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 84%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-12-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 84%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-12-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 84%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-12-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 84%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-12-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 84%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-True-12-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 85%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 85%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 85%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 85%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 85%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 85%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 85%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 86%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 86%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-1-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 86%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-1-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 86%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-1-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 86%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-1-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 86%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-1-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 87%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-1-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 87%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-1-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 87%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-1-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 87%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 87%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 87%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 87%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 88%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 88%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 88%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 88%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 88%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-12-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 88%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-12-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 89%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-12-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 89%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-12-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 89%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-12-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 89%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-12-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 89%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-12-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 89%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-True-False-12-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 90%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 90%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 90%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 90%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 90%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 90%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 90%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 91%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 91%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-1-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 91%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-1-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 91%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-1-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 91%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-1-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 91%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-1-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 92%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-1-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 92%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-1-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 92%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-1-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 92%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 92%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 92%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 92%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 93%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 93%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 93%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 93%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 93%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-12-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 93%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-12-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 94%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-12-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 94%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-12-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 94%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-12-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 94%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-12-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 94%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-12-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 94%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-True-12-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 95%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 95%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 95%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 95%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 95%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 95%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 95%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 96%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 96%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-1-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 96%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-1-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 96%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-1-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 96%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-1-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 96%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-1-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 97%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-1-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 97%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-1-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 97%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-1-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 97%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 97%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 97%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m         [ 97%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 98%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 98%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 98%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 98%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 98%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-12-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 98%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-12-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 99%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-12-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m        [ 99%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-12-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 99%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-12-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 99%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-12-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m      [ 99%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-12-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m       [ 99%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_rnn[cuda-relu-False-False-12-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m      [100%]\u001b[0m\n","\n","\u001b[32m============================== \u001b[32m\u001b[1m640 passed\u001b[0m, \u001b[33m1163 deselected\u001b[0m\u001b[32m in 15.96s\u001b[0m\u001b[32m ===============================\u001b[0m\n"]}],"source":["!python3 -m pytest -l -v -k \"test_rnn\""]},{"cell_type":"code","execution_count":null,"metadata":{"id":"eJHDRileg1-M"},"outputs":[],"source":["!python3 -m mugrade submit \"YOUR KEY HERE\" -k \"rnn\""]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"LxbEZj9xg1-M"},"source":["## Part 5: Long short-term memory network [10 points]\n","In `python/needle/nn/nn_sequence.py`, implement `Sigmoid`.\n","\n","$\\sigma(x) = \\frac{1}{1 + \\text{exp}(-x)}$\n","\n","In `python/needle/nn/nn_sequence.py`, implement `LSTMCell`.\n","\n","\\begin{align}\n","i &= \\sigma(xW_{ii} + b_{ii} + hW_{hi} + b_{hi}) \\\\\n","f &= \\sigma(xW_{if} + b_{if} + hW_{hf} + b_{hf}) \\\\\n","g &= \\text{tanh}(xW_{ig} + b_{ig} + hW_{hg} + b_{hg}) \\\\\n","o &= \\sigma(xW_{io} + b_{io} + hW_{ho} + b_{ho}) \\\\\n","c^\\prime &= f * c + i * g \\\\\n","h^\\prime &= o * \\text{tanh}(c^\\prime)\n","\\end{align}\n","\n","where $\\sigma$ is the sigmoid function, and $i$, $f$, $g$, $o$ are the input, forget, cell, and output gates, respectively.\n","\n","All weights and biases should be initialized from $\\mathcal{U}(-\\sqrt{k}, \\sqrt{k})$ where $k=\\frac{1}{\\text{hidden_size}}$.\n","\n","Now implement `LSTM` in `python/needle/nn/nn_sequence.py`, which applies a multi-layer LSTM RNN to an input sequence. For each element in the input sequence, each layer computes the following function:\n","\n","\\begin{align}\n","i_t &= \\sigma(x_tW_{ii} + b_{ii} + h_{(t-1)}W_{hi} + b_{hi}) \\\\\n","f_t &= \\sigma(x_tW_{if} + b_{if} + h_{(t-1)}W_{hf} + b_{hf}) \\\\\n","g_t &= \\text{tanh}(x_tW_{ig} + b_{ig} + h_{(t-1)}W_{hg} + b_{hg}) \\\\\n","o_t &= \\sigma(x_tW_{io} + b_{io} + h_{(t-1)}W_{ho} + b_{ho}) \\\\\n","c_t &= f * c_{(t-1)} + i * g \\\\\n","h_t &= o * \\text{tanh}(c_t)\n","\\end{align},\n","where $h_t$ is the hidden state at time $t$, $c_t$ is the cell state at time $t$, $x_t$ is the input at time $t$, $h_{(t-1)}$ is the hidden state of the layer at time $t-1$ or the initial hidden state at time $0$, and $i_t$, $f_t$, $g_t$, $o_t$ are the input, forget, cell, and output gates at time $t$ respectively.\n","\n","In a multi-layer LSTM, the input $x_t^{(l)}$ of the $l$-th layer ($l \\ge 2$) is the hidden state $h_t^{(l-1)}$ of the previous layer."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":330099,"status":"ok","timestamp":1703486183900,"user":{"displayName":"伍嘉辉","userId":"06711267999106587498"},"user_tz":-480},"id":"admNfzfag1-N","outputId":"b9082252-8ebb-45db-b300-a2ef6a1bf108"},"outputs":[{"name":"stdout","output_type":"stream","text":["\u001b[1m======================================= test session starts ========================================\u001b[0m\n","platform linux -- Python 3.10.12, pytest-7.4.3, pluggy-1.3.0 -- /usr/bin/python3\n","cachedir: .pytest_cache\n","rootdir: /content/drive/Othercomputers/My MacBook Pro/hw4\n","plugins: anyio-3.7.1\n","collected 1803 items / 1483 deselected / 320 selected                                              \u001b[0m\n","\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-True-True-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m                [  0%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-True-True-1-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m               [  0%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-True-True-1-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [  0%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-True-True-1-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m              [  1%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-True-True-12-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [  1%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-True-True-12-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m              [  1%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-True-True-12-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [  2%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-True-True-12-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m             [  2%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-True-False-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [  2%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-True-False-1-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m              [  3%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-True-False-1-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [  3%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-True-False-1-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m             [  3%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-True-False-12-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [  4%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-True-False-12-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m             [  4%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-True-False-12-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [  4%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-True-False-12-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m            [  5%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-False-True-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [  5%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-False-True-1-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m              [  5%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-False-True-1-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [  5%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-False-True-1-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m             [  6%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-False-True-12-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [  6%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-False-True-12-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m             [  6%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-False-True-12-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [  7%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-False-True-12-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m            [  7%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-False-False-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [  7%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-False-False-1-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m             [  8%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-False-False-1-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [  8%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-False-False-1-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m            [  8%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-False-False-12-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [  9%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-False-False-12-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m            [  9%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-False-False-12-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [  9%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cpu-False-False-12-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 10%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-True-True-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 10%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-True-True-1-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 10%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-True-True-1-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 10%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-True-True-1-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 11%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-True-True-12-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 11%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-True-True-12-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 11%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-True-True-12-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 12%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-True-True-12-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 12%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-True-False-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 12%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-True-False-1-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 13%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-True-False-1-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 13%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-True-False-1-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 13%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-True-False-12-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 14%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-True-False-12-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 14%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-True-False-12-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 14%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-True-False-12-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 15%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-False-True-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 15%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-False-True-1-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 15%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-False-True-1-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 15%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-False-True-1-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 16%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-False-True-12-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 16%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-False-True-12-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 16%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-False-True-12-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 17%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-False-True-12-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 17%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-False-False-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 17%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-False-False-1-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 18%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-False-False-1-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 18%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-False-False-1-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 18%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-False-False-12-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 19%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-False-False-12-1-15] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 19%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-False-False-12-11-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 19%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm_cell[cuda-False-False-12-11-15] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 20%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m                 [ 20%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m                [ 20%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m                 [ 20%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m                [ 21%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m                [ 21%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 21%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m                [ 22%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 22%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-1-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m                [ 22%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-1-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 23%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-1-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m                [ 23%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-1-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 23%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-1-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 24%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-1-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 24%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-1-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 24%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-1-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 25%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m                [ 25%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 25%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m                [ 25%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 26%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 26%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 26%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 27%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 27%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-12-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 27%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-12-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 28%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-12-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 28%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-12-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 28%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-12-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 29%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-12-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 29%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-12-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 29%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-True-12-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 30%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m                [ 30%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 30%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m                [ 30%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 31%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 31%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 31%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 32%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 32%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-1-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 32%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-1-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 33%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-1-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 33%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-1-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 33%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-1-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 34%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-1-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 34%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-1-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 34%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-1-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 35%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 35%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 35%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 35%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 36%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 36%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 36%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 37%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 37%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-12-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 37%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-12-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 38%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-12-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 38%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-12-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 38%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-12-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 39%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-12-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 39%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-12-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 39%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-True-False-12-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 40%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m                [ 40%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 40%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m                [ 40%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 41%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 41%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 41%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 42%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 42%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-1-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 42%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-1-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 43%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-1-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 43%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-1-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 43%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-1-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 44%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-1-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 44%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-1-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 44%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-1-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 45%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 45%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 45%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 45%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 46%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 46%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 46%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 47%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 47%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-12-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 47%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-12-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 48%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-12-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 48%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-12-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 48%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-12-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 49%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-12-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 49%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-12-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 49%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-True-12-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 50%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 50%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 50%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 50%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 51%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 51%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 51%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 52%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 52%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-1-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 52%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-1-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 53%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-1-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 53%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-1-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 53%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-1-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 54%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-1-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 54%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-1-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 54%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-1-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 55%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 55%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 55%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 55%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 56%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 56%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 56%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 57%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 57%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-12-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 57%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-12-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 58%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-12-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 58%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-12-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 58%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-12-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 59%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-12-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 59%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-12-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 59%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cpu-False-False-12-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 60%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m                [ 60%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 60%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m                [ 60%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 61%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 61%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 61%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 62%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 62%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-1-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 62%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-1-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 63%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-1-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 63%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-1-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 63%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-1-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 64%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-1-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 64%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-1-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 64%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-1-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 65%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 65%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 65%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 65%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 66%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 66%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 66%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 67%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 67%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-12-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 67%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-12-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 68%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-12-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 68%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-12-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 68%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-12-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 69%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-12-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 69%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-12-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 69%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-True-12-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 70%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 70%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 70%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 70%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 71%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 71%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 71%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 72%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 72%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-1-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 72%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-1-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 73%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-1-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 73%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-1-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 73%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-1-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 74%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-1-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 74%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-1-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 74%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-1-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 75%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 75%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 75%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 75%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 76%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 76%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 76%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 77%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 77%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-12-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 77%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-12-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 78%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-12-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 78%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-12-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 78%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-12-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 79%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-12-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 79%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-12-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 79%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-True-False-12-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 80%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 80%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 80%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m               [ 80%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 81%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 81%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 81%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 82%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 82%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-1-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 82%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-1-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 83%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-1-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 83%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-1-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 83%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-1-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 84%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-1-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 84%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-1-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 84%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-1-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 85%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 85%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 85%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 85%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 86%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 86%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 86%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 87%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 87%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-12-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 87%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-12-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 88%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-12-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 88%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-12-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 88%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-12-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 89%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-12-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 89%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-12-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 89%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-True-12-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 90%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 90%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 90%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m              [ 90%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 91%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 91%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 91%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 92%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 92%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-1-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 92%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-1-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 93%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-1-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 93%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-1-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 93%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-1-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 94%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-1-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 94%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-1-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 94%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-1-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 95%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 95%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 95%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m             [ 95%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 96%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 96%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 96%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 97%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 97%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-12-11-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 97%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-12-11-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 98%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-12-11-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m            [ 98%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-12-11-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 98%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-12-11-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 99%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-12-11-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [ 99%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-12-11-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m           [ 99%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_lstm[cuda-False-False-12-11-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m          [100%]\u001b[0m\n","\n","\u001b[32m========================= \u001b[32m\u001b[1m320 passed\u001b[0m, \u001b[33m1483 deselected\u001b[0m\u001b[32m in 327.84s (0:05:27)\u001b[0m\u001b[32m =========================\u001b[0m\n"]}],"source":["!python3 -m pytest -l -v -k \"test_lstm\""]},{"cell_type":"code","execution_count":null,"metadata":{"id":"9qy5p6xwg1-N"},"outputs":[],"source":["!python3 -m mugrade submit \"YOUR KEY HERE\" -k \"lstm\""]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"F-k-5Pg1g1-N"},"source":["## Part 6: Penn Treebank dataset [10 points]\n","\n","In word-level language modeling tasks, the model predicts the probability of the next word in the sequence, based on the words already observed in the sequence. You will write support for the Penn Treebank dataset, which consists of stories from the Wall Street Journal, to train and evaluate a language model on word-level prediction.\n","\n","In `python/needle/data/datasets/ptb_dataset.py`, start by implementing the `Dictionary` class, which creates a dictionary from a list of words, mapping each word to a unique integer.\n","\n","Next, we will use this `Dictionary` class to create a corpus from the train and test txt files in the Penn Treebank dataset that you downloaded at the beginning of the notebook. Implement the `tokenize` function in the `Corpus` class to do this.\n","\n","In order to prepare the data for training and evaluation, you will next implement the `batchify` function. Starting from sequential data, batchify arranges the dataset into columns. For instance, with the alphabet as the sequence and batch size 4, we'd get\n","\n","```\n","┌ a g m s ┐\n","│ b h n t │\n","│ c i o u │\n","│ d j p v │\n","│ e k q w │\n","└ f l r x ┘\n","```\n","\n","These columns are treated as independent by the model, which means that the dependence of e. g. 'g' on 'f' cannot be learned, but allows more efficient batch processing.\n","\n","Next, implement the `get_batch` function. `get_batch` subdivides the source data into chunks of length `bptt`. If source is equal to the example output of the batchify function, with a bptt-limit of 2, we'd get the following two Variables for i = 0:\n","```\n","┌ a g m s ┐ ┌ b h n t ┐\n","└ b h n t ┘ └ c i o u ┘\n","```\n","Note that despite the name of the function, the subdivison of data is not done along the batch dimension (i.e. dimension 1), since that was handled by the batchify function. The chunks are along dimension 0, corresponding to the seq_len dimension in the LSTM or RNN."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":35349,"status":"ok","timestamp":1703486463890,"user":{"displayName":"伍嘉辉","userId":"06711267999106587498"},"user_tz":-480},"id":"yBIDIrbrg1-N","outputId":"8cb9c54a-d210-4dff-f9ca-f4469fa7df2e"},"outputs":[{"name":"stdout","output_type":"stream","text":["\u001b[1m======================================= test session starts ========================================\u001b[0m\n","platform linux -- Python 3.10.12, pytest-7.4.3, pluggy-1.3.0 -- /usr/bin/python3\n","cachedir: .pytest_cache\n","rootdir: /content/drive/Othercomputers/My MacBook Pro/hw4\n","plugins: anyio-3.7.1\n","collected 1803 items / 1777 deselected / 26 selected                                               \u001b[0m\n","\n","tests/hw4/test_cifar_ptb_data.py::test_cifar10_dataset[True] \u001b[32mPASSED\u001b[0m\u001b[32m                          [  3%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_cifar10_dataset[False] \u001b[32mPASSED\u001b[0m\u001b[32m                         [  7%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_cifar10_loader[cpu-True-1] \u001b[32mPASSED\u001b[0m\u001b[32m                     [ 11%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_cifar10_loader[cpu-True-15] \u001b[32mPASSED\u001b[0m\u001b[32m                    [ 15%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_cifar10_loader[cpu-False-1] \u001b[32mPASSED\u001b[0m\u001b[32m                    [ 19%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_cifar10_loader[cpu-False-15] \u001b[32mPASSED\u001b[0m\u001b[32m                   [ 23%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_cifar10_loader[cuda-True-1] \u001b[32mPASSED\u001b[0m\u001b[32m                    [ 26%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_cifar10_loader[cuda-True-15] \u001b[32mPASSED\u001b[0m\u001b[32m                   [ 30%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_cifar10_loader[cuda-False-1] \u001b[32mPASSED\u001b[0m\u001b[32m                   [ 34%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_cifar10_loader[cuda-False-15] \u001b[32mPASSED\u001b[0m\u001b[32m                  [ 38%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_ptb_dataset[cpu-True-3-1] \u001b[32mPASSED\u001b[0m\u001b[32m                      [ 42%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_ptb_dataset[cpu-True-3-15] \u001b[32mPASSED\u001b[0m\u001b[32m                     [ 46%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_ptb_dataset[cpu-True-32-1] \u001b[32mPASSED\u001b[0m\u001b[32m                     [ 50%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_ptb_dataset[cpu-True-32-15] \u001b[32mPASSED\u001b[0m\u001b[32m                    [ 53%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_ptb_dataset[cpu-False-3-1] \u001b[32mPASSED\u001b[0m\u001b[32m                     [ 57%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_ptb_dataset[cpu-False-3-15] \u001b[32mPASSED\u001b[0m\u001b[32m                    [ 61%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_ptb_dataset[cpu-False-32-1] \u001b[32mPASSED\u001b[0m\u001b[32m                    [ 65%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_ptb_dataset[cpu-False-32-15] \u001b[32mPASSED\u001b[0m\u001b[32m                   [ 69%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_ptb_dataset[cuda-True-3-1] \u001b[32mPASSED\u001b[0m\u001b[32m                     [ 73%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_ptb_dataset[cuda-True-3-15] \u001b[32mPASSED\u001b[0m\u001b[32m                    [ 76%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_ptb_dataset[cuda-True-32-1] \u001b[32mPASSED\u001b[0m\u001b[32m                    [ 80%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_ptb_dataset[cuda-True-32-15] \u001b[32mPASSED\u001b[0m\u001b[32m                   [ 84%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_ptb_dataset[cuda-False-3-1] \u001b[32mPASSED\u001b[0m\u001b[32m                    [ 88%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_ptb_dataset[cuda-False-3-15] \u001b[32mPASSED\u001b[0m\u001b[32m                   [ 92%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_ptb_dataset[cuda-False-32-1] \u001b[32mPASSED\u001b[0m\u001b[32m                   [ 96%]\u001b[0m\n","tests/hw4/test_cifar_ptb_data.py::test_ptb_dataset[cuda-False-32-15] \u001b[32mPASSED\u001b[0m\u001b[32m                  [100%]\u001b[0m\n","\n","\u001b[32m=============================== \u001b[32m\u001b[1m26 passed\u001b[0m, \u001b[33m1777 deselected\u001b[0m\u001b[32m in 34.07s\u001b[0m\u001b[32m ===============================\u001b[0m\n"]}],"source":["!python3 -m pytest -l -v -k \"ptb\""]},{"cell_type":"code","execution_count":null,"metadata":{"id":"rSuI0e1vg1-O"},"outputs":[],"source":["!python3 -m mugrade submit \"YOUR KEY HERE\" -k \"ptb\""]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"0iwEcfISg1-O"},"source":["## Part 7: Training a word-level language model [10 points]\n","\n","Finally, you will use the `RNN` and `LSTM` components you have written to construct a language model that we will train on the Penn Treebank dataset.\n","\n","First, in `python/needle/nn/nn_sequence.py` implement `Embedding`. Consider we have a dictionary with 1000 words. Then for a word which indexes into this dictionary, we can represent this word as a one-hot vector of size 1000, and then use a linear layer to project this to a vector of some embedding size.\n","\n","In `apps/models.py`, you can now implement `LanguageModel`. Your language model should consist of\n","\n","- An embedding layer (which maps word IDs to embeddings)\n","- A sequence model (either RNN or LSTM)\n","- A linear layer (which outputs probabilities of the next word)\n","\n","In `apps/simple_ml.py` implement `epoch_general_ptb`, `train_ptb`, and `evaluate_ptb`."]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":353012,"status":"ok","timestamp":1703486827008,"user":{"displayName":"伍嘉辉","userId":"06711267999106587498"},"user_tz":-480},"id":"md6pkeslg1-O","outputId":"9fe5dfab-5432-4edd-8f01-ed5e25386fde"},"outputs":[{"name":"stdout","output_type":"stream","text":["\u001b[1m======================================= test session starts ========================================\u001b[0m\n","platform linux -- Python 3.10.12, pytest-7.4.3, pluggy-1.3.0 -- /usr/bin/python3\n","cachedir: .pytest_cache\n","rootdir: /content/drive/Othercomputers/My MacBook Pro/hw4\n","plugins: anyio-3.7.1\n","collected 1803 items / 1291 deselected / 512 selected                                              \u001b[0m\n","\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  0%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [  0%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  0%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [  0%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  0%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [  1%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  1%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [  1%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-1-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  1%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-1-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [  1%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-1-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  2%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-1-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [  2%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-1-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  2%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-1-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [  2%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-1-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  2%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-1-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [  3%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  3%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [  3%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  3%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [  3%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  4%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [  4%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  4%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [  4%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-12-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  4%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-12-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [  5%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-12-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  5%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-12-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [  5%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-12-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  5%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-12-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [  5%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-12-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  6%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-True-12-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [  6%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  6%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [  6%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  6%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [  7%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  7%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [  7%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  7%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [  7%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-1-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  8%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-1-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [  8%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-1-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  8%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-1-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [  8%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-1-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  8%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-1-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [  8%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-1-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  9%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-1-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [  9%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  9%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [  9%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [  9%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 10%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 10%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 10%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 10%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 10%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-12-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 11%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-12-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 11%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-12-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 11%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-12-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 11%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-12-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 11%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-12-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 12%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-12-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 12%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1-False-12-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 12%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 12%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 12%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 13%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 13%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 13%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 13%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 13%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 14%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-1-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 14%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-1-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 14%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-1-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 14%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-1-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 14%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-1-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 15%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-1-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 15%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-1-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 15%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-1-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 15%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 15%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 16%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 16%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 16%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 16%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 16%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 16%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 17%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-12-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 17%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-12-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 17%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-12-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 17%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-12-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 17%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-12-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 18%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-12-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 18%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-12-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 18%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-True-12-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 18%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 18%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 19%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 19%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 19%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 19%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 19%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 20%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 20%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-1-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 20%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-1-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 20%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-1-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 20%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-1-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 21%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-1-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 21%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-1-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 21%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-1-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 21%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-1-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 21%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 22%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 22%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 22%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 22%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 22%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 23%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 23%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 23%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-12-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 23%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-12-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 23%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-12-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 24%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-12-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 24%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-12-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 24%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-12-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 24%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-12-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 24%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-rnn-1000-False-12-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 25%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 25%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 25%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 25%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 25%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 25%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 26%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 26%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 26%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-1-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 26%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-1-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 26%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-1-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 27%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-1-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 27%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-1-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 27%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-1-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 27%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-1-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 27%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-1-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 28%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 28%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 28%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 28%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 28%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 29%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 29%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 29%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 29%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-12-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 29%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-12-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 30%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-12-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 30%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-12-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 30%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-12-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 30%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-12-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 30%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-12-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 31%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-True-12-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 31%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 31%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 31%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 31%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 32%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 32%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 32%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 32%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 32%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-1-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 33%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-1-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 33%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-1-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 33%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-1-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 33%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-1-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 33%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-1-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 33%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-1-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 34%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-1-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 34%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 34%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 34%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 34%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 35%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 35%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 35%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 35%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 35%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-12-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 36%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-12-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 36%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-12-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 36%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-12-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 36%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-12-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 36%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-12-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 37%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-12-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 37%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1-False-12-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 37%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 37%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 37%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 38%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 38%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 38%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 38%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 38%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 39%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-1-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 39%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-1-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 39%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-1-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 39%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-1-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 39%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-1-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 40%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-1-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 40%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-1-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 40%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-1-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 40%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 40%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 41%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 41%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 41%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 41%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 41%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 41%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 42%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-12-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 42%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-12-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 42%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-12-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 42%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-12-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 42%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-12-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 43%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-12-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 43%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-12-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 43%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-True-12-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 43%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 43%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 44%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 44%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 44%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 44%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 44%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 45%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 45%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-1-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 45%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-1-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 45%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-1-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 45%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-1-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 46%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-1-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 46%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-1-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 46%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-1-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 46%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-1-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 46%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 47%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 47%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 47%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 47%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 47%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 48%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 48%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 48%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-12-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 48%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-12-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 48%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-12-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 49%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-12-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 49%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-12-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 49%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-12-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 49%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-12-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 49%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cpu-lstm-1000-False-12-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 50%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 50%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 50%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 50%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 50%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 50%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 51%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 51%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 51%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-1-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 51%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-1-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 51%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-1-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 52%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-1-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 52%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-1-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 52%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-1-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 52%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-1-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 52%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-1-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 53%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 53%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 53%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 53%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 53%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 54%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 54%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 54%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 54%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-12-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 54%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-12-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 55%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-12-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 55%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-12-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 55%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-12-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 55%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-12-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 55%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-12-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 56%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-True-12-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 56%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 56%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 56%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 56%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 57%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 57%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 57%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 57%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 57%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-1-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 58%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-1-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 58%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-1-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 58%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-1-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 58%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-1-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 58%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-1-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 58%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-1-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 59%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-1-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 59%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 59%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 59%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 59%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 60%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 60%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 60%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 60%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 60%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-12-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 61%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-12-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 61%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-12-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 61%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-12-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 61%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-12-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 61%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-12-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 62%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-12-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 62%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1-False-12-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 62%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 62%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 62%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 63%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 63%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 63%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 63%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 63%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 64%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-1-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 64%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-1-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 64%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-1-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 64%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-1-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 64%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-1-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 65%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-1-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 65%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-1-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 65%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-1-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 65%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 65%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 66%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 66%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 66%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 66%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 66%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 66%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 67%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-12-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 67%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-12-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 67%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-12-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 67%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-12-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 67%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-12-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 68%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-12-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 68%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-12-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 68%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-True-12-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 68%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 68%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 69%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 69%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 69%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 69%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 69%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 70%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 70%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-1-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 70%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-1-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 70%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-1-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 70%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-1-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 71%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-1-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 71%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-1-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 71%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-1-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 71%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-1-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 71%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 72%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 72%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 72%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 72%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 72%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 73%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 73%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 73%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-12-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 73%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-12-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 73%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-12-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 74%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-12-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 74%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-12-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 74%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-12-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 74%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-12-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 74%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-rnn-1000-False-12-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 75%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 75%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 75%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 75%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 75%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 75%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 76%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 76%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 76%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-1-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 76%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-1-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 76%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-1-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 77%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-1-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 77%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-1-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 77%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-1-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 77%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-1-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 77%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-1-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 78%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 78%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 78%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 78%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 78%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 79%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 79%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 79%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 79%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-12-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 79%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-12-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 80%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-12-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 80%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-12-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 80%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-12-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 80%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-12-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 80%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-12-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 81%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-True-12-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 81%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 81%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 81%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 81%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 82%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 82%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 82%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 82%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 82%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-1-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 83%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-1-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 83%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-1-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 83%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-1-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 83%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-1-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 83%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-1-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 83%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-1-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 84%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-1-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 84%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 84%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 84%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 84%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 85%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 85%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 85%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 85%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 85%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-12-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 86%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-12-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 86%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-12-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 86%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-12-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 86%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-12-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 86%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-12-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 87%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-12-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 87%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1-False-12-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 87%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 87%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 87%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 88%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 88%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 88%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 88%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 88%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 89%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-1-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 89%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-1-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 89%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-1-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 89%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-1-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 89%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-1-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 90%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-1-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 90%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-1-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 90%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-1-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 90%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 90%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 91%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 91%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 91%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 91%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 91%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 91%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 92%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-12-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 92%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-12-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 92%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-12-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 92%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-12-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 92%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-12-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 93%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-12-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 93%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-12-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 93%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-True-12-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 93%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-1-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 93%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-1-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 94%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-1-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 94%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-1-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 94%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-1-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 94%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-1-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 94%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-1-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 95%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-1-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 95%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-1-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 95%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-1-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 95%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-1-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 95%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-1-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 96%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-1-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 96%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-1-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 96%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-1-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 96%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-1-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 96%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-12-1-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 97%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-12-1-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 97%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-12-1-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 97%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-12-1-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 97%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-12-1-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 97%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-12-1-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 98%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-12-1-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 98%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-12-1-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 98%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-12-34-1-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 98%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-12-34-1-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 98%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-12-34-1-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 99%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-12-34-1-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 99%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-12-34-15-1-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 99%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-12-34-15-1-13] \u001b[32mPASSED\u001b[0m\u001b[32m [ 99%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-12-34-15-2-1] \u001b[32mPASSED\u001b[0m\u001b[32m [ 99%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_implementation[cuda-lstm-1000-False-12-34-15-2-13] \u001b[32mPASSED\u001b[0m\u001b[32m [100%]\u001b[0m\n","\n","\u001b[32m========================= \u001b[32m\u001b[1m512 passed\u001b[0m, \u001b[33m1291 deselected\u001b[0m\u001b[32m in 350.10s (0:05:50)\u001b[0m\u001b[32m =========================\u001b[0m\n"]}],"source":["!python3 -m pytest -l -v -k \"language_model_implementation\""]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":4396,"status":"ok","timestamp":1703486851045,"user":{"displayName":"伍嘉辉","userId":"06711267999106587498"},"user_tz":-480},"id":"Z1z12mIJg1-O","outputId":"aa580234-f5ea-4546-c80e-f63d401ebbd6"},"outputs":[{"name":"stdout","output_type":"stream","text":["\u001b[1m======================================= test session starts ========================================\u001b[0m\n","platform linux -- Python 3.10.12, pytest-7.4.3, pluggy-1.3.0 -- /usr/bin/python3\n","cachedir: .pytest_cache\n","rootdir: /content/drive/Othercomputers/My MacBook Pro/hw4\n","plugins: anyio-3.7.1\n","collected 1803 items / 1801 deselected / 2 selected                                                \u001b[0m\n","\n","tests/hw4/test_sequence_models.py::test_language_model_training[cpu] \u001b[32mPASSED\u001b[0m\u001b[32m                  [ 50%]\u001b[0m\n","tests/hw4/test_sequence_models.py::test_language_model_training[cuda] \u001b[32mPASSED\u001b[0m\u001b[32m                 [100%]\u001b[0m\n","\n","\u001b[32m================================ \u001b[32m\u001b[1m2 passed\u001b[0m, \u001b[33m1801 deselected\u001b[0m\u001b[32m in 2.97s\u001b[0m\u001b[32m ================================\u001b[0m\n"]}],"source":["!python3 -m pytest -l -v -k \"language_model_training\""]},{"cell_type":"code","execution_count":null,"metadata":{"id":"MVVRGrQSg1-P"},"outputs":[],"source":["!python3 -m mugrade submit \"YOUR KEY HERE\" -k \"language_model\""]},{"attachments":{},"cell_type":"markdown","metadata":{"id":"8hpH3Bryg1-P"},"source":["Now, you can train your language model on the Penn Treebank dataset:"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"FNRsueD0g1-P"},"outputs":[],"source":["import needle as ndl\n","sys.path.append('./apps')\n","from models import LanguageModel\n","from simple_ml import train_ptb, evaluate_ptb\n","\n","device = ndl.cuda()\n","corpus = ndl.data.Corpus(\"data/ptb\")\n","train_data = ndl.data.batchify(corpus.train, batch_size=16, device=device, dtype=\"float32\")\n","model = LanguageModel(30, len(corpus.dictionary), hidden_size=10, num_layers=2, seq_model='rnn', device=device)\n","train_ptb(model, train_data, seq_len=1, n_epochs=1, device=device)\n","evaluate_ptb(model, train_data, seq_len=40, device=device)"]}],"metadata":{"accelerator":"GPU","colab":{"gpuType":"T4","provenance":[]},"kernelspec":{"display_name":"Python 3","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.10.9"}},"nbformat":4,"nbformat_minor":0}
